emit job fail events, don't throw
This commit is contained in:
@@ -159,16 +159,13 @@ export default class Job extends events.EventEmitter {
|
|||||||
// job execution failed
|
// job execution failed
|
||||||
if (jobErr.type === 'WorkerTimeout') {
|
if (jobErr.type === 'WorkerTimeout') {
|
||||||
this.debug(`Timeout on job ${job._id}`);
|
this.debug(`Timeout on job ${job._id}`);
|
||||||
|
this.emit('job_timeout', jobErr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.debug(`Failure occurred on job ${job._id}`);
|
this.debug(`Failure occurred on job ${job._id}`);
|
||||||
return this._failJob(job, jobErr.toString())
|
this.emit('job_error', jobErr);
|
||||||
.catch(() => false)
|
return this._failJob(job, jobErr.toString());
|
||||||
.then(() => {
|
|
||||||
this.emit('job_error', jobErr);
|
|
||||||
throw jobErr;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user