Skip to content

Job.update

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

Method Signature

Job.update(message)

Parameter: message String

  • A message added to the job log entry or a reason for the update.

Returns: Promise => true

Example:

job.update('Job data changed').catch((err) => {
  console.error(err)
})

Description

The Job.update method enables you to customise a job any way you like. See the Job Editing document for more detail.

Example

This example changes the data of the job.

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

const job = q.createJob()
job.data = 'foo'


return q.addJob(job).then(() => {
  return q.getJob(job)
}).then((jobs) => {
  jobs[0].data = 'bar'
  return jobs[0].update('Changed foo to bar')
}).catch((err) => {
  console.error(err)
})

Main

How It Works

Contributing

API

Queue Methods

Queue Properties

Queue Events

Job Methods

Job Properties

Documentation

Clone this wiki locally