Skip to content

Commit

Permalink
fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Nov 9, 2019
1 parent fd98947 commit 08ab235
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions lib/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,38 +259,38 @@ const execute = (ctx, obj, isTX, config) => {
spName = 'level_' + ctx.txLevel;
return begin()
.then(() => callback(ctx, obj, ctx.cb, config)
.then(data => {
cbData = data; // save callback data;
success = true;
return commit();
}, err => {
cbReason = err; // save callback failure reason;
return rollback();
})
.then(() => {
if (success) {
update(false, true, cbData);
return cbData;
}
update(false, false, cbReason);
return $p.reject(cbReason);
},
err => {
// either COMMIT or ROLLBACK has failed, which is impossible
// to replicate in a test environment, so skipping from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
}),
.then(data => {
cbData = data; // save callback data;
success = true;
return commit();
}, err => {
cbReason = err; // save callback failure reason;
return rollback();
})
.then(() => {
if (success) {
update(false, true, cbData);
return cbData;
}
update(false, false, cbReason);
return $p.reject(cbReason);
},
err => {
// BEGIN has failed, which is impossible to replicate in a test
// environment, so skipping the whole block from the test;
// either COMMIT or ROLLBACK has failed, which is impossible
// to replicate in a test environment, so skipping from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
});
}),
err => {
// BEGIN has failed, which is impossible to replicate in a test
// environment, so skipping the whole block from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
});
}

function begin() {
Expand Down

0 comments on commit 08ab235

Please sign in to comment.