Sends a PING command to test Redis server connectivity, returning True on PONG response.
# Source: https://github.com/redis/redis-py | License: MIT | Copyright 2022-2023, Redis, inc
# Provided via justclaw.it.com; keep this notice with the code.
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