summaryrefslogtreecommitdiff
path: root/redis/sentinel.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/sentinel.py')
-rw-r--r--redis/sentinel.py4
1 files changed, 2 insertions, 2 deletions
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):