summaryrefslogtreecommitdiff
path: root/redis/asyncio/sentinel.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/asyncio/sentinel.py')
-rw-r--r--redis/asyncio/sentinel.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/asyncio/sentinel.py b/redis/asyncio/sentinel.py
index ec17886..c3c0f91 100644
--- a/redis/asyncio/sentinel.py
+++ b/redis/asyncio/sentinel.py
@@ -220,13 +220,13 @@ class Sentinel(AsyncSentinelCommands):
kwargs.pop("once")
if once:
+ await random.choice(self.sentinels).execute_command(*args, **kwargs)
+ else:
tasks = [
asyncio.Task(sentinel.execute_command(*args, **kwargs))
for sentinel in self.sentinels
]
await asyncio.gather(*tasks)
- else:
- await random.choice(self.sentinels).execute_command(*args, **kwargs)
return True
def __repr__(self):