-
Notifications
You must be signed in to change notification settings - Fork 16
Job.update
Grant Carthew edited this page Oct 10, 2016
·
16 revisions
Parameter: data Object Optional
- Data that will be added to the update log entry
log.dataproperty. - Default: An empty object.
Parameter: message String Optional
- String that will be added to the update log entry
log.messageproperty.
Parameter: type String Optional
- String that will be added to the update log entry
log.typeproperty. Typicallyinformation,warning, orerror.
Parameter: status String Optional
- String that will be added to the update log entry
log.statusproperty.
Returns: Promise => true
Example:
job.update({ foo: 'bar'},
'Job data changed',
'warning',
'active').catch(err => console.error(err))The above signature is correct. The below text has not been update.
The Job.update method enables you to customise a job any way you like. See the Job Editing document for more detail.
This example changes the data of the job.
const Queue = require('rethinkdb-job-queue')
const q = new Queue()
const job = q.createJob({ 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))- Introduction
- Tutorial
- Queue Constructor
- Queue Connection
- Queue Options
- Queue PubSub
- Queue Master
- Queue Events
- State Document
- Job Processing
- Job Options
- Job Status
- Job Retry
- Job Repeat
- Job Logging
- Job Editing
- Job Schema
- Job Name
- Complex Job
- Delayed Job
- Cancel Job
- Error Handling
- Queue.createJob
- Queue.addJob
- Queue.getJob
- Queue.findJob
- Queue.findJobByName
- Queue.containsJobByName
- Queue.cancelJob
- Queue.reanimateJob
- Queue.removeJob
- Queue.process
- Queue.review
- Queue.summary
- Queue.ready
- Queue.pause
- Queue.resume
- Queue.reset
- Queue.stop
- Queue.drop
- Queue.Job
- Queue.host
- Queue.port
- Queue.db
- Queue.name
- Queue.r
- Queue.id
- Queue.jobOptions [R/W]
- Queue.changeFeed
- Queue.master
- Queue.masterInterval
- Queue.removeFinishedJobs
- Queue.running
- Queue.concurrency [R/W]
- Queue.paused
- Queue.idle
- Event.ready
- Event.added
- Event.updated
- Event.active
- Event.processing
- Event.progress
- Event.log
- Event.pausing
- Event.paused
- Event.resumed
- Event.completed
- Event.cancelled
- Event.failed
- Event.terminated
- Event.reanimated
- Event.removed
- Event.idle
- Event.reset
- Event.error
- Event.reviewed
- Event.detached
- Event.stopping
- Event.stopped
- Event.dropped
- Job.setName
- Job.setPriority
- Job.setTimeout
- Job.setDateEnable
- Job.setRetryMax
- Job.setRetryDelay
- Job.setRepeat
- Job.setRepeatDelay
- Job.updateProgress
- Job.update
- Job.getCleanCopy
- Job.addLog
- Job.getLastLog