If any health check responses are present, clean them
(self)
| 1100 | self._execute(connection, connection.send_command, *args, **kwargs) |
| 1101 | |
| 1102 | def clean_health_check_responses(self) -> None: |
| 1103 | """ |
| 1104 | If any health check responses are present, clean them |
| 1105 | """ |
| 1106 | ttl = 10 |
| 1107 | conn = self.connection |
| 1108 | while conn and self.health_check_response_counter > 0 and ttl > 0: |
| 1109 | if self._execute(conn, conn.can_read, timeout=conn.socket_timeout): |
| 1110 | response = self._execute(conn, conn.read_response) |
| 1111 | if self.is_health_check_response(response): |
| 1112 | self.health_check_response_counter -= 1 |
| 1113 | else: |
| 1114 | raise PubSubError( |
| 1115 | "A non health check response was cleaned by " |
| 1116 | "execute_command: {}".format(response) |
| 1117 | ) |
| 1118 | ttl -= 1 |
| 1119 | |
| 1120 | def _reconnect( |
| 1121 | self, |
no test coverage detected