Skip to content

[Question] Retry Utility #103

@metallurgix

Description

@metallurgix

I am trying to integrate Bee-Queue in my new project and have few questions regarding the retry function after a job failure.
Basically I want by job to be re-tried 5 times before it is marked as failed.

Here is the sample code for which I am using for my project:

File1.js

const Queue = require('bee-queue');
const queue = new Queue('task1',{isWorker:false});
queue.createJob({}).retries(5).save()

File2.js

const Queue = require('bee-queue');
const queue = new Queue('task1');
queue.process(async (job) => {
  try{
    //Some DB Functions
  }
  catch{
    return Promise.reject()
  }
});

The problem is, when the an error is encountered, the task state is set as 'failed' and is never being retried.

I would like a little advice on how to proceed with fixing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions