-
-
Notifications
You must be signed in to change notification settings - Fork 303
Improves wait_exponential_jitter #426
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
base: main
Are you sure you want to change the base?
Conversation
|
Is there anything blocking this from being merged? Deprecation concerns? It's been almost 1 year. |
|
Hi @yxtay ,
The correct thing to do is to leave the implementation of |
| result = self.max | ||
| return max(0, min(result, self.max)) | ||
| result = super().__call__(retry_state) + random.uniform(0, self.jitter) | ||
| return max(self.min, min(result, self.max)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the min part should be equal to max(0, self.min) (in case self.min is negative + follow same formula as wait_exponential)
|
👋 I was just looking at implementing the Would it make sense to split those commits off to be merged while @LotfiRafik 's comments are addressed? |
Summary
Improves wait_exponential_jitter to inherit wait_exponential
- Reuses
wait_exponential.__call__method instead of of duplicating code- Follows argument names of wait_exponential
- Adds
minargument- Supports supplying
max,jitter,minarguments astimedeltaTests