-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
134127d
commit e0a1e8c
Showing
3 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
gitbook/docs/managing-jobs/manually-working/repeatevery.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# RepeatEvery | ||
|
||
|
||
|
||
## `job.repeatEvery(interval, options?)` | ||
|
||
{% hint style="info" %} | ||
The `repeatEvery` method schedules a job to repeat at a defined interval. It includes options to specify starting and ending dates, skip specific days, and adjust for time zones, providing flexibility in how and when the job recurs. | ||
{% endhint %} | ||
|
||
### Example Usage | ||
|
||
{% code fullWidth="false" %} | ||
```typescript | ||
job.unique({ 'data.type': 'email', 'data.userId': '12345' }); | ||
await job.save(); // If you want to save it | ||
``` | ||
{% endcode %} | ||
|
||
### Parameters | ||
|
||
* **`interval`** (`string`): A human-readable string that specifies how often the job should run, such as `'5 minutes'`, `'2 hours'`, `'1 day'`. | ||
* **`options`** (`JobOptions` - optional): Additional settings to further configure the repeating job: | ||
* **`timezone`** (`string` - optional): The timezone in which to base the job's timing. | ||
* **`startDate`** (`Date | number` - optional): A specific start date or timestamp from which the job should start repeating. | ||
* **`endDate`** (`Date | number` - optional): A specific end date or timestamp after which the job should no longer repeat. | ||
* **`skipDays`** (`string` - optional): A string representing days to skip, useful for setting jobs to run only on specific days of the week. | ||
* **`skipImmediate`** (`boolean` - optional): If `true`, skips the immediate first execution of the job schedule. | ||
|
||
\ | ||
|
||
|
||
### Returns | ||
|
||
* **`Job`**: Returns the job instance, allowing for method chaining. | ||
|
||
\ | ||
|
||
|
||
|
||
|