Skip to content
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

Allow retry period to be cancelled by context #212

Merged
merged 4 commits into from
Dec 29, 2022

Conversation

rtrox
Copy link
Contributor

@rtrox rtrox commented Dec 28, 2022

Currently, given the use of time.Sleep, retry time periods completely ignore the context passed into the function. This PR swaps the sleep logic to instead use a select and time.After, so that context cancellation will successfully cancel the sleep. The behavior in this PR is just to return the original error if context is cancelled during the retry Sleep. If you'd prefer, I can also swap to return a context cancellation, too.
Signed-off-by: Russell Troxel russelltroxel@gmail.com

@strideynet strideynet merged commit 135b212 into zmb3:master Dec 29, 2022
@strideynet
Copy link
Collaborator

Many thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants