(self, failures: int)
| 149 | self._previous_backoff = 0 |
| 150 | |
| 151 | def compute(self, failures: int) -> float: |
| 152 | max_backoff = max(self._base, self._previous_backoff * 3) |
| 153 | temp = random.uniform(self._base, max_backoff) |
| 154 | self._previous_backoff = min(self._cap, temp) |
| 155 | return self._previous_backoff |
| 156 | |
| 157 | |
| 158 | class ExponentialWithJitterBackoff(AbstractBackoff): |