Skip to content
This repository has been archived by the owner on May 1, 2018. It is now read-only.

Commit

Permalink
🐛 passing newState props
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfoo committed Oct 14, 2015
1 parent b37b4e5 commit b956d2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export default function(opts) {

const state = (error ? 'FAIL' : 'SUCCESS');

const newState = {state, error};
const newState = { state, error};
try {
events.emit('job:set-state:init', {job, newState});
events.emit('job:set-state:init', {job, ...newState});
await apiClient.setState(_id, newState);
events.emit('job:set-state:success', {job, newState});
events.emit('job:set-state:success', {job, ...newState});
} catch (_error) {
debug('setState failed', _error);

events.emit('job:set-state:fail', {job, newState, error: _error});
events.emit('job:set-state:fail', {job, ...newState, error: _error});
}

callback(error);
Expand Down

0 comments on commit b956d2c

Please sign in to comment.