Skip to content

Commit

Permalink
Fix Sentinel.execute_command to execute across the entire sentinel cl…
Browse files Browse the repository at this point in the history
…uster (#2459)

* Change sentinel execute command to execute across the entire cluster

* Add change to CHANGES file
  • Loading branch information
SyedTahaA authored Nov 21, 2022
1 parent 59c8e7d commit e425674
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions redis/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ def execute_command(self, *args, **kwargs):
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):
Expand Down

0 comments on commit e425674

Please sign in to comment.