check_redis.py 204 B

1234567
  1. import redis
  2. try:
  3. r = redis.Redis(host='localhost', port=6379, db=0, socket_timeout=5)
  4. print(f"PING: {r.ping()}")
  5. print("Redis is ALIVE")
  6. except Exception as e:
  7. print(f"Redis ERROR: {e}")