|
24 | 24 |
|
25 | 25 | from ._parsers import Encoder, _HiredisParser, _RESP2Parser, _RESP3Parser
|
26 | 26 | from .auth.token import TokenInterface
|
27 |
| -from .backoff import ExponentialWithJitterBackoff |
| 27 | +from .backoff import NoBackoff |
28 | 28 | from .credentials import CredentialProvider, UsernamePasswordCredentialProvider
|
29 | 29 | from .event import AfterConnectionReleasedEvent, EventDispatcher
|
30 | 30 | from .exceptions import (
|
@@ -322,15 +322,16 @@ def __init__(
|
322 | 322 | # Add TimeoutError to the errors list to retry on
|
323 | 323 | retry_on_error.append(TimeoutError)
|
324 | 324 | self.retry_on_error = retry_on_error
|
325 |
| - if retry is None: |
326 |
| - self.retry = Retry( |
327 |
| - backoff=ExponentialWithJitterBackoff(base=1, cap=10), retries=3 |
328 |
| - ) |
329 |
| - else: |
330 |
| - # deep-copy the Retry object as it is mutable |
331 |
| - self.retry = copy.deepcopy(retry) |
332 |
| - if retry_on_error: |
| 325 | + if retry or retry_on_error: |
| 326 | + if retry is None: |
| 327 | + self.retry = Retry(NoBackoff(), 1) |
| 328 | + else: |
| 329 | + # deep-copy the Retry object as it is mutable |
| 330 | + self.retry = copy.deepcopy(retry) |
| 331 | + # Update the retry's supported errors with the specified errors |
333 | 332 | self.retry.update_supported_errors(retry_on_error)
|
| 333 | + else: |
| 334 | + self.retry = Retry(NoBackoff(), 0) |
334 | 335 | self.health_check_interval = health_check_interval
|
335 | 336 | self.next_health_check = 0
|
336 | 337 | self.redis_connect_func = redis_connect_func
|
|
0 commit comments