File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {
1111 RepeatStrategy ,
1212} from '../types'
1313import type { RedisConnection } from './redis-connection'
14- import { parseExpression } from 'cron-parser'
14+ import CronParser from 'cron-parser'
1515import { SpanKind , TelemetryAttributes } from '../enums'
1616import { array2obj } from '../utils'
1717import { Job } from './job'
@@ -451,9 +451,12 @@ export class JobScheduler extends QueueBase {
451451
452452export 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 } )
Original file line number Diff line number Diff line change @@ -11,11 +11,7 @@ import type {
1111import type { JobProgress , MinimalQueue } from '../types'
1212import * as fs from 'node:fs'
1313import * as path from 'node:path'
14-
1514import { 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'
1915import { v4 } from 'uuid'
2016import { SpanKind , TelemetryAttributes } from '../enums'
2117import {
You can’t perform that action at this time.
0 commit comments