add completed time and status to failed jobs

with tests
This commit is contained in:
2016-05-02 12:59:23 -07:00
parent b12aa87ad3
commit a143092e64
2 changed files with 27 additions and 0 deletions

View File

@@ -132,7 +132,10 @@ export default class Job extends events.EventEmitter {
throw err;
});
}, (err) => {
const completedTime = moment().toISOString();
const doc = {
status: jobStatuses.JOB_STATUS_FAILED,
completed_at: completedTime,
output: {
content_type: false,
content: err.toString()