Connects to the Redis server if not already connected
(self)
| 345 | self._parser = parser_class(socket_read_size=self._socket_read_size) |
| 346 | |
| 347 | async def connect(self): |
| 348 | """Connects to the Redis server if not already connected""" |
| 349 | # try once the socket connect with the handshake, retry the whole |
| 350 | # connect/handshake flow based on retry policy |
| 351 | await self.retry.call_with_retry( |
| 352 | lambda: self.connect_check_health( |
| 353 | check_health=True, retry_socket_connect=False |
| 354 | ), |
| 355 | lambda error, failure_count: self.disconnect( |
| 356 | error=error, failure_count=failure_count |
| 357 | ), |
| 358 | with_failure_count=True, |
| 359 | ) |
| 360 | |
| 361 | async def connect_check_health( |
| 362 | self, check_health: bool = True, retry_socket_connect: bool = True |
no test coverage detected