|
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 (
|
@@ -323,15 +323,16 @@ def __init__(
|
323 | 323 | # Add TimeoutError to the errors list to retry on
|
324 | 324 | retry_on_error.append(TimeoutError)
|
325 | 325 | self.retry_on_error = retry_on_error
|
326 |
| - if retry is None: |
327 |
| - self.retry = Retry( |
328 |
| - backoff=ExponentialWithJitterBackoff(base=1, cap=10), retries=3 |
329 |
| - ) |
330 |
| - else: |
331 |
| - # deep-copy the Retry object as it is mutable |
332 |
| - self.retry = copy.deepcopy(retry) |
333 |
| - if retry_on_error: |
| 326 | + if retry or retry_on_error: |
| 327 | + if retry is None: |
| 328 | + self.retry = Retry(NoBackoff(), 1) |
| 329 | + else: |
| 330 | + # deep-copy the Retry object as it is mutable |
| 331 | + self.retry = copy.deepcopy(retry) |
| 332 | + # Update the retry's supported errors with the specified errors |
334 | 333 | self.retry.update_supported_errors(retry_on_error)
|
| 334 | + else: |
| 335 | + self.retry = Retry(NoBackoff(), 0) |
335 | 336 | self.health_check_interval = health_check_interval
|
336 | 337 | self.next_health_check = 0
|
337 | 338 | self.redis_connect_func = redis_connect_func
|
|
0 commit comments