From 5e0ceea80a11e657ce0dc3f2cff90e9dc1c20131 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Mon, 22 Nov 2021 09:48:25 -0500 Subject: [PATCH] Update aioredis/client.py Co-authored-by: Bruce Merry <1963944+bmerry@users.noreply.github.com> --- aioredis/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aioredis/client.py b/aioredis/client.py index 212c6adc1..ae22ccc66 100644 --- a/aioredis/client.py +++ b/aioredis/client.py @@ -4047,9 +4047,11 @@ async def parse_response(self, block: bool = True, timeout: float = 0): return None response = await self._execute(conn, conn.read_response) + # The response depends on whether there were any subscriptions + # active at the time the PING was issued. if conn.health_check_interval and response in ( - self.health_check_response, - self.health_check_message_b, + self.health_check_response, # If there was at least one subscription + self.health_check_message_b, # If there wasn't ): # ignore the health check message as user might not expect it return None