Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit 1982253

Browse files
committed
Fix detecting when it is the last attempt
- SlotNotCoveredError, was re-raising the exception one attempt too soon. - Similarly log_exception
1 parent bb865ed commit 1982253

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rediscluster/client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def _execute_command(self, *args, **kwargs):
590590
connection_error_retry_counter = 0
591591

592592
def log_exception(message, exception):
593-
if ttl == 1:
593+
if ttl == 0:
594594
# This is the last attempt before we run out of TTL, so log the full exception.
595595
log.exception(message)
596596
else:
@@ -647,7 +647,7 @@ def log_exception(message, exception):
647647
time.sleep(0.1)
648648

649649
# This is the last attempt before we run out of TTL, raise the exception
650-
if ttl == 1:
650+
if ttl == 0:
651651
raise e
652652
except (RedisClusterException, BusyLoadingError):
653653
log.exception("RedisClusterException || BusyLoadingError")

0 commit comments

Comments
 (0)