MCPcopy
hub / github.com/redis/redis-py / connect

Method connect

redis/connection.py:1003–1012  ·  view source on GitHub ↗

Connects to the Redis server if not already connected

(self)

Source from the content-addressed store, hash-verified

1001 return self._parser
1002
1003 def connect(self):
1004 "Connects to the Redis server if not already connected"
1005 # try once the socket connect with the handshake, retry the whole
1006 # connect/handshake flow based on retry policy
1007 self.retry.call_with_retry(
1008 lambda: self.connect_check_health(
1009 check_health=True, retry_socket_connect=False
1010 ),
1011 lambda error: self.disconnect(error),
1012 )
1013
1014 def connect_check_health(
1015 self, check_health: bool = True, retry_socket_connect: bool = True

Callers 7

can_readMethod · 0.95
_connectMethod · 0.45
connectMethod · 0.45
_wrap_socket_with_sslMethod · 0.45
_connectMethod · 0.45
get_connectionMethod · 0.45
get_connectionMethod · 0.45

Calls 3

connect_check_healthMethod · 0.95
disconnectMethod · 0.95
call_with_retryMethod · 0.45

Tested by

no test coverage detected