From d8fda8b1debc45ce0747cb5a227df4d34516c429 Mon Sep 17 00:00:00 2001 From: petrau Date: Thu, 9 Aug 2018 11:59:08 +0200 Subject: [PATCH] [agenda] Added 'skipImmediate' field in 'options' argument of Job.repeatEvery method --- types/agenda/agenda-tests.ts | 4 ++++ types/agenda/index.d.ts | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index 2c011efaf7..8e0e8b9fb6 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -81,6 +81,10 @@ var mongoConnectionString = "mongodb://127.0.0.1/agenda"; job.repeatEvery('10 minutes'); + job.repeatEvery('10 minutes', { timezone: 'America/New_York' }); + + job.repeatEvery('10 minutes', { skipImmediate: true }); + job.repeatAt('3:30pm'); job.schedule('tomorrow at 6pm'); diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index be07b84aaf..206d40daf3 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -343,10 +343,11 @@ declare namespace Agenda { /** * Specifies an interval on which the job should repeat. * @param interval A human-readable format String, a cron format String, or a Number. - * @param options An optional argument that can include a timezone field. The timezone should be a string as - * accepted by moment-timezone and is considered when using an interval in the cron string format. + * @param options An optional argument that can include a timezone field or skipImmediate field. + * The timezone should be a string as accepted by moment-timezone and is considered when using an interval in the cron string format. + * Setting skipImmediate as true will skip the immediate run. The first run will occur only in configured interval. */ - repeatEvery(interval: string | number, options?: { timezone?: string }): this + repeatEvery(interval: string | number, options?: { timezone?: string, skipImmediate?: boolean }): this /** * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples).