-
Notifications
You must be signed in to change notification settings - Fork 221
[Question] Retry Utility #103
Copy link
Copy link
Closed
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels