Skip to content

Job.dateEnable

Grant Carthew edited this page Feb 10, 2017 · 5 revisions

Property Details

Usage: Read / Write

Get: Date

  • Returns a JavaScript Date object representing when the job processing can be started.

Example:

const Queue = require('rethinkdb-job-queue')
const q = new Queue()
let job = q.createJob()

q.addJob(job).then(() => {
  return q.getJob(job.id)
}).then((savedJobs) => {
  // savedJobs[0].dateEnable === The date the job processing can commence.
}).catch(err => console.error(err))

Description

The dateEnable property of a job determines at what date and time the job is available for processing.

By default, if you do not change the dateEnable value it is set to the same value as the dateCreated property. By doing this the job is available for processing immediately.

If you change the dateEnable value on a job that has not been processed yet, or is queued for a retry, it will be delayed until the current time has moved past the value you assigned.

Warning: On a queue that is not busy it is possible for a custom dateEnable value to cause the job to be processed after the custom date and on the next master review process. Do not consider the date you assign to be the exact date and time the job will be processed.

For more detail and examples about the dateEnable property, see the Delayed Job document.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally