diff options
author | Theron Luhn <theron@luhn.com> | 2021-09-30 03:34:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 13:34:39 +0300 |
commit | bfc4cd92c8070de9bfa7736ef21b44eb6fe35ed9 (patch) | |
tree | 84700046094f8c47c6b5f2cf97d4eca57409ffcc | |
parent | 799c13965f99e0863dae5aa712d70733d9cff210 (diff) | |
download | redis-py-bfc4cd92c8070de9bfa7736ef21b44eb6fe35ed9.tar.gz |
Auto-reconnect PubSub on `get_message` (#1574)
-rwxr-xr-x | redis/client.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py index 7a022a0..cbdb13d 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1259,7 +1259,10 @@ class PubSub: self.check_health() - if not block and not conn.can_read(timeout=timeout): + if( + not block + and not self._execute(conn, conn.can_read, timeout=timeout) + ): return None response = self._execute(conn, conn.read_response) |