[agenda] Added 'skipImmediate' field in 'options' argument of Job.repeatEvery method

This commit is contained in:
petrau
2018-08-09 11:59:08 +02:00
parent f11a334248
commit d8fda8b1de
2 changed files with 8 additions and 3 deletions

View File

@@ -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');

View File

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