5

Looking for a way to have bull retry failed jobs with a higher priority. More specifically, I would like failed jobs to be picked up before any non-failed job.

It's fairly easy to set stuff like 'number of retries', but nothing else regarding the retry policy afaik.

Geert-Jan
  • 18,623
  • 16
  • 75
  • 137
  • 1
    Still looking for an answer to this one as well. – Evil Buck Feb 15 '21 at 16:17
  • [This](https://stackoverflow.com/a/61731727/9642772) stack overflow answer suggests catching the error and adding it back to the queue with a higher priority. – Moshe G Mar 07 '21 at 02:24

1 Answers1

0

You can specify the priority like this :

let newJob = await myQueue.add('queue-name', job.data, { ...{ priority: 1 }, ...job.opts });
Imad Salki
  • 416
  • 3
  • 4