# JobQueueOptions.drainRequeue property · @imqueue/job

Source: https://imqueue.org/api/job/latest/job.jobqueueoptions.drainrequeue/
Published: 2026-08-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/job 3.3.0 — generated reference, not hand-written

Put jobs the drain gave up on back on the queue before exiting.

**Signature:**

```typescript
drainRequeue?: boolean;
```

## Default Value

the `IMQ_DRAIN_REQUEUE` environment variable, itself `true`

## Remarks

This closes the hole the drain itself opens. Safe delivery releases a job's worker key as soon as the job reaches the handler, so a job the drain abandons at its budget is not checked out to anybody and nothing re-queues it — it is simply gone. Re-pushing it on the way out makes that attempt recoverable.

The cost is the usual at-least-once one, and it is worth stating plainly: the abandoned handler is still running when its job is pushed back, so the job can both complete and be delivered again. That is the same duplicate a lease expiry would produce, and the reason handlers must be idempotent.

Turn it off if a duplicate is worse than a lost attempt.

