rename the worker timeout error
This commit is contained in:
@@ -10,5 +10,5 @@ export default {
|
|||||||
EVENT_WORKER_JOB_FAIL: 'worker:job failed',
|
EVENT_WORKER_JOB_FAIL: 'worker:job failed',
|
||||||
EVENT_WORKER_JOB_FAIL_ERROR: 'worker:failed job update error',
|
EVENT_WORKER_JOB_FAIL_ERROR: 'worker:failed job update error',
|
||||||
EVENT_WORKER_JOB_EXECUTION_ERROR: 'worker:job execution error',
|
EVENT_WORKER_JOB_EXECUTION_ERROR: 'worker:job execution error',
|
||||||
EVENT_WORKER_JOB_TIMEOUT_ERROR: 'worker:job timeout',
|
EVENT_WORKER_JOB_TIMEOUT: 'worker:job timeout',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ export default class Job extends events.EventEmitter {
|
|||||||
output: docOutput,
|
output: docOutput,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.emit(constants.EVENT_WORKER_COMPLETE, eventOutput)
|
this.emit(constants.EVENT_WORKER_COMPLETE, eventOutput);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (err.statusCode === 409) return false;
|
if (err.statusCode === 409) return false;
|
||||||
@@ -229,7 +229,7 @@ export default class Job extends events.EventEmitter {
|
|||||||
// job execution failed
|
// job execution failed
|
||||||
if (jobErr.type === 'WorkerTimeoutError') {
|
if (jobErr.type === 'WorkerTimeoutError') {
|
||||||
this.debug(`Timeout on job ${job._id}`);
|
this.debug(`Timeout on job ${job._id}`);
|
||||||
this.emit(constants.EVENT_WORKER_JOB_TIMEOUT_ERROR, this._formatErrorParams(jobErr, job));
|
this.emit(constants.EVENT_WORKER_JOB_TIMEOUT, this._formatErrorParams(jobErr, job));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -738,7 +738,7 @@ describe('Worker class', function () {
|
|||||||
let performJobPromise;
|
let performJobPromise;
|
||||||
|
|
||||||
// check for timeout event
|
// check for timeout event
|
||||||
worker.once(constants.EVENT_WORKER_JOB_TIMEOUT_ERROR, (err) => {
|
worker.once(constants.EVENT_WORKER_JOB_TIMEOUT, (err) => {
|
||||||
try {
|
try {
|
||||||
expect(err).to.have.property('error');
|
expect(err).to.have.property('error');
|
||||||
expect(err).to.have.property('job');
|
expect(err).to.have.property('job');
|
||||||
|
|||||||
Reference in New Issue
Block a user