-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to inspect upcoming sleep in
stop
funcs, and add `stop_…
…before_delay` (#423) * Add upcoming_sleep to retry_state, and add stop_before_delay stop. * Add unit test to cover stop_before_delay. * Changelog. * Update docs for stop_before_delay. * More docs for the two stop_x_delay functions. * Add test to ensure it acts the same as stop_after_delay when upcoming sleep is 0. * Linter fixups. --------- Co-authored-by: Julien Danjou <[email protected]>
- Loading branch information
1 parent
ebee81d
commit 99e7482
Showing
5 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
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
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/add-stop-before-delay-a775f88ac872c923.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
features: | ||
- | | ||
Added a new stop function: stop_before_delay, which will stop execution | ||
if the next sleep time would cause overall delay to exceed the specified delay. | ||
Useful for use cases where you have some upper bound on retry times that you must | ||
not exceed, so returning before that timeout is preferable than returning after that timeout. |
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 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 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