fix: always complete job, no try

This commit is contained in:
Gergo Moricz 2024-08-07 19:39:09 +02:00
parent 191dfbd9ca
commit a1c2ee5aa9

View File

@ -52,11 +52,7 @@ const processJobInternal = async (token: string, job: Job) => {
const result = await processJob(job, token);
const jobState = await job.getState();
if (jobState !== "completed" && jobState !== "failed") {
try{
await job.moveToCompleted(result.docs, token, false); //3rd arg fetchNext
}catch(e){
// console.log("Job already completed, error:", e);
}
await job.moveToCompleted(result.docs, token, false);
}
} catch (error) {
console.log("Job failed, error:", error);