Sends a PING command to test Redis server connectivity, returning True on PONG response.
def ping(self, message: Union[str, None] = None) -> bool:
"""
Ping the Redis server to test connectivity.
Sends a PING command to the Redis server and returns True if the server
responds with "PONG".
"""
args = ["PING", message] if message is not None else ["PING"]
return self.execute_command(*args)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key