Trying to figure out how to make retries work.
this is how my FB queue looks :
{
"specs" : {
"default_spec" : {
"retries" : 3,
"timeout" : 60000
}
},
"tasks" : {
}
}
and this is how I'm testing if retries work:
const queue = new Queue(getFirebaseRef(),{'numWorkers': 10} , function (data, progress, resolve, reject) {
console.log('processing queue message:' + JSON.stringify(data));
progress(50);
setTimeout(()=>{
reject(new Error("error while processing blabla"));
},2000);
});
so when I push new task to queue , this is how it looks after being processed by my worker :
{
"-KcsTIDBAq1S_fdiwsv6" : {
"_error_details" : {
"attempts" : 1,
"error" : "error while processing blabla",
"error_stack" : "Error: error while processing blabla\n at Timeout.setTimeout ...,
"previous_state" : "in_progress"
},
"_progress" : 50,
"_state" : "error",
"_state_changed" : 1487089675432,
"body" : {
"testing" : "this_is_a_test_task"
}
}
}
so I would expect attempts to be 3 , I also have no indication in the service that 3 tasks were handled.
Question is , how can I get the retries to work. worth mentioning that this is what I did after reading documentation
Eventually it was a combination of what @Caerbannog wrote and adding the default_spec in code instead of directly inserting it in Firebase console.
so to recap those were my changes :
and