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.
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? |
…tter` `wait_exponential` already supports `min` and `timedelta` for min/max. `wait_exponential_jitter` lacked both, which was an inconsistency users asked for in #426. - Accept `timedelta` for `max`, `jitter`, and `min` parameters - Add `min` parameter to set a minimum wait time floor - Convert all time parameters via `_utils.to_seconds()` in `__init__` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Change-Id: Ic02ae68b863cc0d1cd5a3b7874006c193c0c14a8
…tter` (#628) `wait_exponential` already supports `min` and `timedelta` for min/max. `wait_exponential_jitter` lacked both, which was an inconsistency users asked for in #426. - Accept `timedelta` for `max`, `jitter`, and `min` parameters - Add `min` parameter to set a minimum wait time floor - Convert all time parameters via `_utils.to_seconds()` in `__init__` Change-Id: Ic02ae68b863cc0d1cd5a3b7874006c193c0c14a8 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
Superseded by #628 and #629, which implement the features from this PR (min param, timedelta support, multiplier) while avoiding the inheritance-based approach that introduced the clamping-order bug. Thanks for the ideas @LotfiRafik! |
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