Queue & Stats
Queue statistics, dead letter operations, pause/resume, and cleanup.
Queue statistics, dead letter operations, pause/resume, and cleanup.
Scan-heavy calls (marked Promise below) run off the JS event loop on a
background thread pool.
| Method | Description |
|---|---|
stats() → Promise<Stats> / statsByQueue(q) → Promise<Stats> / statsAllQueues() → Promise<Record<string, Stats>> | Counts by status. |
getMetrics(sinceMs, task?) → Promise<Metric[]> | Raw per-execution metric rows recorded at or after the Unix-ms sinceMs. |
| Method | Description |
|---|---|
deadLetters() → Promise<DeadJob[]> / retryDead(id) / deleteDead(id) / purgeDead(ms) → Promise<number> | DLQ (dead-letter queue) ops. |
| Method | Description |
|---|---|
requeueJob(id) → boolean | Force a stuck running job back to pending, releasing its execution claim. false when the job is missing or isn't running. |
requeueJob() preserves the job's retry budget, but only use it when the
owning worker is confirmed dead or hung: if the old attempt is still running,
it may finish later and the job executes twice. See
troubleshooting.
| Method | Description |
|---|---|
pauseQueue(q) / resumeQueue(q) / listPausedQueues() | Queue control. |
| Method | Description |
|---|---|
purgeCompleted(ms) → Promise<number> | Drop old completed jobs. |