Skip to content

Commit c03ef63

Browse files
committed
Clear the health check counter the first subscription
1 parent d0a95fa commit c03ef63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

redis/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,8 @@ def psubscribe(self, *args, **kwargs):
14801480
if not self.subscribed:
14811481
# Set the subscribed_event flag to True
14821482
self.subscribed_event.set()
1483+
# Clear the health check counter
1484+
self.health_check_response_counter = 0
14831485
self.pending_unsubscribe_patterns.difference_update(new_patterns)
14841486
return ret_val
14851487

@@ -1517,6 +1519,8 @@ def subscribe(self, *args, **kwargs):
15171519
if not self.subscribed:
15181520
# Set the subscribed_event flag to True
15191521
self.subscribed_event.set()
1522+
# Clear the health check counter
1523+
self.health_check_response_counter = 0
15201524
self.pending_unsubscribe_channels.difference_update(new_channels)
15211525
return ret_val
15221526

0 commit comments

Comments
 (0)