mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-12-04 12:08:14 +00:00
The worker's failed handler decided a failure was final by comparing attemptsMade to opts.attempts. An UnrecoverableError (disk full, gated auth) skips BullMQ's retries and fails on attempt 1 of 10, so that check never fired. A Wikipedia download that hit a full disk stayed at "downloading", and failed auto-updates never advanced their backoff. Use job.finishedOn instead. BullMQ sets it only when a job moves to the failed set for good. User cancels also throw UnrecoverableError, so they now count as terminal. Exclude them from the auto-update backoff with a shared RunDownloadJob.CANCELLED_PREFIX, so a cancel can't self-disable an update.