Skip to content

Job Repeat

Grant Carthew edited this page Nov 20, 2016 · 9 revisions

Description

If you have a task that needs to be processed repeatedly on a specific schedule there are a number of packages on NPM you can use to help you achieve this. However, if you need a job to repeat with a simple delay between each run, rethinkdb-job-queue can do this for you.

When you create a Job object you can set the repeat and the repeatDelay options. These allow you to repeat the processing of jobs either for a fixed number of times or continuously.

By setting the repeat option to true the job will continually repeat after waiting for the repeatDelay time period. Alternatively, you can set the repeat option to a number and the job will be processed and then repeated the correct number of times.

Warning: Do not set the retryDelay value too low unless the repeated job takes a long time to run. Judge the delay time related to the task as hand.

Examples

The following example will repeat every five minutes with the assumption the job only take a few milliseconds to complete.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally