-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
I was just taking a look at the source code and saw this, the condition seems inverted:
redis-py/redis/asyncio/sentinel.py
Lines 222 to 229 in 66a4d6b
if once: | |
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) |
In the non-async Sentinel it seems correct:
https://github.com/redis/redis-py/blob/master/redis/sentinel.py#L202-L206
If needed, I can help with a PR (I just need to look at the tests to see if we can create one that would catch this).