diff options
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | redis/sentinel.py | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -28,6 +28,7 @@ * Fixed "cannot pickle '_thread.lock' object" bug (#2354, #2297) * Added CredentialsProvider class to support password rotation * Enable Lock for asyncio cluster mode + * Fix Sentinel.execute_command doesn't execute across the entire sentinel cluster bug (#2458) * 4.1.3 (Feb 8, 2022) * Fix flushdb and flushall (#1926) diff --git a/redis/sentinel.py b/redis/sentinel.py index d35abaf..d70b714 100644 --- a/redis/sentinel.py +++ b/redis/sentinel.py @@ -200,10 +200,10 @@ class Sentinel(SentinelCommands): kwargs.pop("once") if once: + random.choice(self.sentinels).execute_command(*args, **kwargs) + else: for sentinel in self.sentinels: sentinel.execute_command(*args, **kwargs) - else: - random.choice(self.sentinels).execute_command(*args, **kwargs) return True def __repr__(self): |
