Skip to content

Commit 194863f

Browse files
committed
PYTHON-5505 Remove unused "no_retry" flag
1 parent 65fbd7e commit 194863f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pymongo/asynchronous/helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,12 @@ async def _backoff(
9292
def _retry_overload(func: F) -> F:
9393
@functools.wraps(func)
9494
async def inner(*args: Any, **kwargs: Any) -> Any:
95-
no_retry = kwargs.pop("no_retry", False)
9695
attempt = 0
9796
while True:
9897
try:
9998
return await func(*args, **kwargs)
10099
except PyMongoError as exc:
101-
if no_retry or not exc.has_error_label("Retryable"):
100+
if not exc.has_error_label("Retryable"):
102101
raise
103102
attempt += 1
104103
if attempt > _MAX_RETRIES:

pymongo/synchronous/helpers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,12 @@ def _backoff(
9292
def _retry_overload(func: F) -> F:
9393
@functools.wraps(func)
9494
def inner(*args: Any, **kwargs: Any) -> Any:
95-
no_retry = kwargs.pop("no_retry", False)
9695
attempt = 0
9796
while True:
9897
try:
9998
return func(*args, **kwargs)
10099
except PyMongoError as exc:
101-
if no_retry or not exc.has_error_label("Retryable"):
100+
if not exc.has_error_label("Retryable"):
102101
raise
103102
attempt += 1
104103
if attempt > _MAX_RETRIES:

0 commit comments

Comments
 (0)