JobQueueOptions.safeLockTtl property

The longest, in milliseconds, a job may be worked on before it is treated as abandoned and moved back onto the queue for another worker.

Signature:

safeLockTtl?: number;

Default Value

10000

Remarks

This is a processing deadline. Set it above the longest an onPop handler can legitimately take, with headroom: a worker that is alive and still working on a job past this budget has that job reclaimed and handed to another worker, so it runs twice. The 10 second default is far below @imqueue/core's own 300000 — this package lowers it, it does not raise it — and a handler that awaits a slow upstream for longer than that is duplicated under default settings. Raise it before that happens.

It is not how a dead worker's job is recovered. Process death is detected from the owner leaving the broker's client list on the watcher's next sweep, within seconds and regardless of this value; the deadline exists for the case liveness cannot see — a handler wedged inside a worker that is otherwise up and serving. Maps to IMQOptions.safeDeliveryTtl, whose documentation is the contract.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.