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
The payload for this job.
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
Optional
parentObject that contains parentId (id) and parent queueKey.
Optional
parentFully qualified key (including the queue prefix) pointing to the parent of 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: ParentOptsGet children job keys if this job is a parent and has children.
Optional
opts: DependenciesOptsdependencies 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
opts: { 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.
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
Completely remove the job from the queue. Note, this call will throw an exception if the job is being processed when the call is performed.
Optional
opts: { Options to remove a job
Optional
removeAttempts to retry the job. Only a job that has failed or completed can be retried.
Optional
state: FinishedStatuscompleted / 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
Sets a batch of jobs for this job.
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)
Static
fromInstantiates a JobPro instance based on a standard Job instance.
Generated using TypeDoc
See
Job