JobQueueOptions.drainTimeout property

Milliseconds a drain waits for jobs in flight before giving up on them. Ignored unless JobQueueOptions.drain is on.

Signature:

drainTimeout?: number;

Default Value

the IMQ_DRAIN_TIMEOUT environment variable, itself DEFAULT_IMQ_DRAIN_TIMEOUT (4000)

Remarks

The wait is always bounded and the process always exits. This is the number to raise for jobs that legitimately take longer than a few seconds — the 4000 default is sized for the imq stop CLI, not for your handlers. Whatever is still running when it expires is abandoned, and JobQueueOptions.drainRequeue decides whether it comes back.

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