Touch

job.touch(progress?)

The touch method updates the lockedAt timestamp of a job to the current time. This is particularly useful for ensuring that a job remains locked during long-running processes, preventing it from being considered as timed out or available for reprocessing by other workers or job instances.

Example Usage

const job = pulse.create('test', {});
job.touch(10);

Parameters

  • progress (number?): An optional argument that indicates progress value for the proceeding task.

Returns

  • Promise<Job>: A promise that resolves with the updated job instance after the lockedAt time has been refreshed and the job has been saved.

Last updated