The name of the Job
The payload for this job.
The options object for this job.
Optional
id: stringNumber of attempts after the job has failed.
0
Number of attempts when job is moved to active.
0
The payload for this job.
Optional
debounceDebounce identifier.
use deduplicationId
Optional
deduplicationDeduplication identifier.
An amount of milliseconds to wait until this job can be processed.
0
Reason for failing.
Optional
finishedTimestamp for when the job finished (completed or failed).
Optional
idThe name of the Job
The options object for this job.
Optional
parentObject that contains parentId (id) and parent queueKey.
Optional
parentFully qualified key (including the queue prefix) pointing to the parent of this job.
Ranges from 0 (highest priority) to 2 097 152 (lowest priority). Note that using priorities has a slight impact on performance, so do not use it if not required.
0
Optional
processedThe worker name that is processing or processed this job.
Optional
processedTimestamp for when the job was processed.
The progress a job has performed so far.
0
Readonly
queueIt includes the prefix, the namespace separator :, and queue name.
Optional
repeatBase repeat job key.
The value returned by the processor when processing this job.
null
Stacktrace for the error (for failed jobs).
null
Timestamp when the job was created (unless overridden with job options).
Optional
tokenThe token used for locking this job.
the prefix that is used.
the queue name this job belongs to.
Adds the job to Redis.
Optional
parentOpts: ParentOptsPrepares a job to be passed to Sandbox.
Get children job keys if this job is a parent and has children.
dependencies separated by processed and unprocessed.
Count options before Redis v7.2 works as expected with any quantity of entries on processed/unprocessed dependencies, since v7.2 you must consider that count won't have any effect until processed/unprocessed dependencies have a length greater than 127
https://redis.io/docs/management/optimization/memory-optimization/#redis--72
Get children job counts if this job is a parent and has children.
Optional
processed?: booleanOptional
unprocessed?: booleandependencies count separated by processed and unprocessed.
Moves a job to the completed queue. Returned job to be used with Queue.prototype.nextJobFromJobData.
The jobs success message.
Worker token used to acquire completed job.
True when wanting to fetch the next job.
Returns the jobData of the next job in the waiting queue or void.
Moves a job to the failed queue.
the jobs error message.
token to check job is locked by current worker
true when wanting to fetch the next job
Returns the jobData of the next job in the waiting queue or void.
Moves the job to the waiting-children set.
Token to check job is locked by current worker
The options bag for moving a job to waiting-children.
true if the job was moved
Attempts to retry the job. Only a job that has failed or completed can be retried.
completed / failed
If resolved and return code is 1, then the queue emits a waiting event otherwise the operation was not a success and throw the corresponding error. If the promise rejects, it indicates that the script failed to execute
Updates a job's data
the data that will replace the current jobs data.
Returns a promise the resolves when the job has completed (containing the return value of the job), or rejects when the job has failed (containing the failedReason).
Instance of QueueEvents.
Optional
ttl: numberTime in milliseconds to wait for job to finish before timing out.
Static
addaddJobLog
Queue instance
Job id
Log row
Optional
keepLogs: numberoptional maximum number of logs to keep
The total number of log entries for this job so far.
Static
createCreates a new job and adds it to the queue.
the queue where to add the job.
the name of the job.
the payload of the job.
Optional
opts: JobsOptionsthe options bag for this job.
Static
createCreates a bulk of jobs and adds them atomically to the given queue.
the queue were to add the jobs.
an array of jobs to be added to the queue.
Static
fromStatic
fromJSONInstantiates a Job from a JobJsonRaw object (coming from a deserialized JSON object)
the queue where the job belongs to.
the plain object containing the job.
Optional
jobId: stringan optional job id (overrides the id coming from the JSON object)
Generated using TypeDoc
Job
This class represents a Job in the queue. Normally job are implicitly created when you add a job to the queue with methods such as Queue.addJob( ... )
A Job instance is also passed to the Worker's process function.
Job