Custom backoffs in nestjs bullmq

138 views Asked by At

I want to set the custom backoff for my queue in nestjs.

BullModule.registerQueue({
  name: POST_QUEUES.PARSE_POST_QUEUE,
  defaultJobOptions: {
    backoff: { type: 'exponential', delay: JOB_DELAY_TIME.ONE_SECOND },
    attempts: 10,
  },
}),

I want to replace this exponential backoff with the custom one where for AccountNotFound exception the delay would be 20 seconds and for any other exception delay would be 5 seconds.

0

There are 0 answers