Skip to content

Commit 13d679a

Browse files
committed
Trigger failure with metaData and failed date
1 parent 9d131f9 commit 13d679a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ export class Queue {
327327

328328
this.jobStore.removeJob(rawJob);
329329
} catch (error) {
330-
worker.triggerFailure(job, error);
331330
const { attempts } = rawJob;
332331
// tslint:disable-next-line: prefer-const
333332
let { errors, failedAttempts } = JSON.parse(rawJob.metaData);
@@ -337,6 +336,7 @@ export class Queue {
337336
failed = new Date().toISOString();
338337
}
339338
const metaData = JSON.stringify({ errors: [...errors, error], failedAttempts });
339+
worker.triggerFailure({ ...job, metaData, failed }, error);
340340
this.jobStore.updateJob({ ...rawJob, ...{ active: FALSE, metaData, failed } });
341341
} finally {
342342
delete this.runningJobPromises[job.id]

0 commit comments

Comments
 (0)