property QueuePluginOptions.deadLetterTtlMs
Since 0.3.0

How long a dead-lettered job's payload is retained, in milliseconds.

Omitted (the default) keeps today's behaviour: the payload is retained indefinitely "for debugging", so the jobs hash grows without bound for the lifetime of the deployment (X8-4). Applied only by the Redis adapter, and only when the injected client exposes expire.

Enforced PER PAYLOAD: each dead-letter sweeps the dead set — scored by dead-letter time — and deletes every entry older than this, so a queue that keeps failing still drops its oldest payloads. Setting it also relocates a dead job's payload from queue:<name>:jobs, which holds every queued job's payload for that name, into queue:<name>:dead:jobs.

The retention it delivers is a bound rather than a deadline: AT LEAST this long, and AT MOST this long past the LAST dead-letter on the queue — so a payload that dies just before a short burst can live for just under twice this value. The sweep runs only when a dead-letter arrives, and the key-level backstop beside it carries one deadline for a shared key, which must be the newest or it would take newer payloads with it. It errs late deliberately: dropping a payload early discards the debugging data this option exists to keep.

Type

number

Usage

import { type QueuePluginOptions } from "queue-plugin/src/index.ts";