Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Aug 3, 2016
1 parent 2df2063 commit 6c24008
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ Runner.prototype = {
var jobdata = self.jobdata.pop(job._id);
if (!jobdata) return next(err);

// Mark jobs as finished.
delete jobdata.data;
jobdata.finished = new Date();

if (err) {
jobdata.errored = true;
jobdata.error = {
Expand All @@ -392,14 +396,10 @@ Runner.prototype = {
};
self.emitter.emit('browser.update', job.project.name, 'job.status.errored', [job._id, jobdata.error]);

delete jobdata.data;
jobdata.finished = new Date();
debug(`[runner:${self.id}] Job done with error. Project: ${job.project.name} Job ID: ${job._id}`);
return next(err);
}

delete jobdata.data;
jobdata.finished = new Date();
self.emitter.emit('job.done', jobdata);
debug(`[runner:${self.id}] Job done without error. Project: ${job.project.name} Job ID: ${job._id}`);
next();
Expand Down

0 comments on commit 6c24008

Please sign in to comment.