Skip to content

Job.update

Grant Carthew edited this page Sep 19, 2016 · 16 revisions

Description

This method is one of the most powerful methods within rethinkdb-job-queue. It enables you to customize an existing job in the queue any way you like.

Imagine a really important job you add to the queue that fails processing until it gets classified as terminated. The terminated job status means the job is dead and will not be processed.

Using the Job.update method you can recover this job easily. All you need to do is get the job using Queue.getJob and then change the status of the job to waiting. You probably will need to change the Job.retryCount and Job.dateEnable values also.

Now just call Job.update() supplying a reason message for logging purposes and the job will be reanimated.

Here is a short list of possible uses for Job.update.

  • Recovering a terminated job.
  • Re-running a completed job.

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally