diff options
author | SyedTahaA <62918944+SyedTahaA@users.noreply.github.com> | 2022-11-21 05:57:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 12:57:30 +0200 |
commit | e425674d84a63762f16d5b44b19aa70119fcd814 (patch) | |
tree | ad7d4516cee7b448a3d338f7968125b6c3021090 | |
parent | 59c8e7d05a5cf79c933f0c7e0fef0dfee93b0ed4 (diff) | |
download | redis-py-e425674d84a63762f16d5b44b19aa70119fcd814.tar.gz |
Fix Sentinel.execute_command to execute across the entire sentinel cluster (#2459)
* Change sentinel execute command to execute across the entire cluster
* Add change to CHANGES file
-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): |