From 2b130f9106bee11554b659872f2a9df22ad4452e Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 15 Jul 2018 15:27:05 -0400 Subject: [PATCH] Bull: Add 'every' RepeatOptions property (#27227) * add 'every' repeatoptions property * fix linting * version number * remove patch version from header --- types/bull/index.d.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 17780d7d97..009e26ef95 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -159,11 +159,6 @@ declare namespace Bull { } interface RepeatOptions { - /** - * Cron pattern specifying when the job should execute - */ - cron: string; - /** * Timezone */ @@ -180,6 +175,20 @@ declare namespace Bull { limit?: number; } + interface CronRepeatOptions extends RepeatOptions { + /** + * Cron pattern specifying when the job should execute + */ + cron: string; + } + + interface EveryRepeatOptions extends RepeatOptions { + /** + * Repeat every millis (cron setting cannot be used together with this setting.) + */ + every: number; + } + interface JobOptions { /** * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). @@ -201,7 +210,7 @@ declare namespace Bull { /** * Repeat job according to a cron specification */ - repeat?: RepeatOptions; + repeat?: CronRepeatOptions | EveryRepeatOptions; /** * Backoff setting for automatic retries if the job fails