New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(backoff): allow no delay arg when setting immediate strategy #154
Merged
skeggse
merged 1 commit into
bee-queue:master
from
mixmaxhq:ghmeier/allow-immediate-backoff
Feb 21, 2020
Merged
fix(backoff): allow no delay arg when setting immediate strategy #154
skeggse
merged 1 commit into
bee-queue:master
from
mixmaxhq:ghmeier/allow-immediate-backoff
Feb 21, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
Bump on this ☝️ |
@ghmeier I just added you to the Bee Queue org, so you can merge this. @LewisJEllis - Garret is an engineer on our team |
skeggse
force-pushed
the
ghmeier/allow-immediate-backoff
branch
2 times, most recently
from
January 27, 2020 23:45
dada8ad
to
fac1f67
Compare
skeggse
force-pushed
the
ghmeier/allow-immediate-backoff
branch
from
February 21, 2020 16:44
c9f7632
to
a4d8059
Compare
skeggse
changed the title
Allow non-positive integer delays for immediate backoff strategy
fix(backoff): allow no delay arg when setting immediate strategy
Feb 21, 2020
skeggse
force-pushed
the
ghmeier/allow-immediate-backoff
branch
from
February 21, 2020 16:57
a4d8059
to
e1a1c40
Compare
This comment has been minimized.
This comment has been minimized.
… test Per [the documentation](https://github.com/mixmaxhq/bee-queue#jobbackoffstrategy-delayfactor) you should be able to call `job.backoff('immediate')` to set an immediate backoff strategy for retried jobs. However, the `backoff` method explicitly disallowed this by checking for `Number.isSafeInteger(undefined)` which returns false. This means you currently cannot specify an immediate backoff strategy without also specifying a positive delay value. To fix this, only check for valid integers when the strategy is not `immediate`. Co-Authored-By: Hugh Secker-Walker <hsw@hodain.net>
skeggse
force-pushed
the
ghmeier/allow-immediate-backoff
branch
from
February 21, 2020 17:01
e1a1c40
to
d9155c9
Compare
skeggse
approved these changes
Feb 21, 2020
beequeueci
pushed a commit
that referenced
this pull request
Nov 2, 2020
## [1.3.0](v1.2.3...v1.3.0) (2020-11-02) ### Features * implement Queue#saveAll feature ([#198](#198)) ([851f09d](851f09d)) * support custom strategies on a queue ([#134](#134)) ([926de9d](926de9d)) * **types:** add generics to type definitions ([a565d3d](a565d3d)) * **types:** add isRunning ([c488385](c488385)) * **types:** add ready handler ([32c4b1e](32c4b1e)) ### Bug Fixes * **backoff:** allow no delay arg when setting immediate strategy ([#154](#154)) ([6f1d62f](6f1d62f)) * **queue:** remove error event listener on close ([#231](#231)) ([36b4904](36b4904)) * **removeJob:** remove job from stored jobs ([#230](#230)) ([a8c9d87](a8c9d87)) * **types:** support progress events using arbitrary data ([#140](#140)) ([bc8aa52](bc8aa52)) * **types:** update createJob handler for consistency ([b71a993](b71a993)) * **types:** update redis option type ([#290](#290)) ([e80c51d](e80c51d)) * **types:** update type declaration ([#252](#252)) ([1dce7ca](1dce7ca)) * misc edge case fixes ([a2df983](a2df983)) * update typescript declarations and add documentation ([#187](#187)) ([cec1498](cec1498)), closes [#138](#138)
beequeueci
pushed a commit
that referenced
this pull request
Nov 3, 2020
## [1.3.0](v1.2.3...v1.3.0) (2020-11-03) ### Features * implement Queue#saveAll feature ([#198](#198)) ([851f09d](851f09d)) * support custom strategies on a queue ([#134](#134)) ([926de9d](926de9d)) * **types:** add generics to type definitions ([a565d3d](a565d3d)) * **types:** add isRunning ([c488385](c488385)) * **types:** add ready handler ([32c4b1e](32c4b1e)) ### Bug Fixes * **backoff:** allow no delay arg when setting immediate strategy ([#154](#154)) ([6f1d62f](6f1d62f)) * **queue:** remove error event listener on close ([#231](#231)) ([36b4904](36b4904)) * **removeJob:** remove job from stored jobs ([#230](#230)) ([a8c9d87](a8c9d87)) * **types:** support progress events using arbitrary data ([#140](#140)) ([bc8aa52](bc8aa52)) * **types:** update createJob handler for consistency ([b71a993](b71a993)) * **types:** update redis option type ([#290](#290)) ([e80c51d](e80c51d)) * **types:** update type declaration ([#252](#252)) ([1dce7ca](1dce7ca)) * misc edge case fixes ([a2df983](a2df983)) * update typescript declarations and add documentation ([#187](#187)) ([cec1498](cec1498)), closes [#138](#138)
🎉 This PR is included in version 1.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the documentation you should be able to call
job.backoff('immediate')
to set an immediate backoff strategy for retried jobs. However, thebackoff
method explicitly disallowed this by checking forNumber.isSafeInteger(undefined)
which returns false. This means you currently cannot specify an immediate backoff strategy without also specifying a positive delay value.To fix this, only check for valid integers when the strategy is not
immediate
.