Skip to content

Commit 1927dde

Browse files
committed
chore: wip
1 parent fe4bfc0 commit 1927dde

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/classes/job-scheduler.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111
RepeatStrategy,
1212
} from '../types'
1313
import type { RedisConnection } from './redis-connection'
14-
import { parseExpression } from 'cron-parser'
14+
import CronParser from 'cron-parser'
1515
import { SpanKind, TelemetryAttributes } from '../enums'
1616
import { array2obj } from '../utils'
1717
import { Job } from './job'
@@ -451,9 +451,12 @@ export class JobScheduler extends QueueBase {
451451

452452
export function defaultRepeatStrategy(millis: number, opts: RepeatOptions): number | undefined {
453453
const { pattern } = opts
454+
if (!pattern) {
455+
return undefined
456+
}
454457

455458
const currentDate = new Date(millis)
456-
const interval = parseExpression(pattern, {
459+
const interval = CronParser.parse(pattern, {
457460
...opts,
458461
currentDate,
459462
})

src/classes/worker.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import type {
1111
import type { JobProgress, MinimalQueue } from '../types'
1212
import * as fs from 'node:fs'
1313
import * as path from 'node:path'
14-
1514
import { URL } from 'node:url'
16-
17-
// Note: this Polyfill is only needed for Node versions < 15.4.0
18-
import { AbortController } from 'node-abort-controller'
1915
import { v4 } from 'uuid'
2016
import { SpanKind, TelemetryAttributes } from '../enums'
2117
import {

0 commit comments

Comments
 (0)