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).