Skip to content

Commit

Permalink
Fix expiration not starting at execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Grondin committed May 3, 2018
1 parent dd8e103 commit 4cfee33
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bottleneck.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
}, wait),
expiration: next.options.expiration != null ? setTimeout(() => {
return completed(new Bottleneck.prototype.BottleneckError(`This job timed out after ${next.options.expiration} ms.`));
}, next.options.expiration) : void 0,
}, wait + next.options.expiration) : void 0,
job: next
};
}
Expand Down
2 changes: 1 addition & 1 deletion bottleneck.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Bottleneck.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
}, wait),
expiration: next.options.expiration != null ? setTimeout(() => {
return completed(new Bottleneck.prototype.BottleneckError(`This job timed out after ${next.options.expiration} ms.`));
}, next.options.expiration) : void 0,
}, wait + next.options.expiration) : void 0,
job: next
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bottleneck.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Bottleneck
, wait
expiration: if next.options.expiration? then setTimeout =>
completed new Bottleneck::BottleneckError "This job timed out after #{next.options.expiration} ms."
, next.options.expiration
, wait + next.options.expiration
job: next
_drainOne: (freed) =>
@_registerLock.schedule =>
Expand Down

0 comments on commit 4cfee33

Please sign in to comment.