Skip to content

Delayed Job

Grant Carthew edited this page Sep 9, 2016 · 17 revisions

What is dateEnable?

One of the extremely important properties of the rethinkdb-job-queue Job objects is the dateEnable property. Every job in the queue will have a dateEnable property and it will be populated with a date.

When the Queue object is processing jobs in the queue backing Table it runs an internal function called getNextJob(). This function queries the RethinkDB database for jobs that need processing. If the dateEnable property of a job in the queue has a date that is set to some time in the future, the job will not be retrieved.

This gives us the flexibility to be able to set the date and time we want the job to be processed prior to adding the job to the queue.

Warning: Jobs that are delayed in a relative inactive queue will only be processed at the Queue Master review time interval. Because of this your delayed jobs will only run after the dateEnable date and on the next Queue Master review process. This will not be an issue if the queue is very busy.

Here is an example delaying a job by three days

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally