scwrypts/py/redis/client.py
yage e8bb889789 v2.2.0
=====================================================================

--- New Scripts --------------------------

zsh )
  amazon EKS
   - aws/eks/login

--- Changes ------------------------------

- moved global .config to global/config.zsh
- moved various global configurations to global/

--- Bug Fixes ----------------------------

- REDIS_AUTH no longer required to attempt connection
- global configurations now propagate to non-zsh scripts
2022-08-09 13:18:41 -06:00

16 lines
384 B
Python

from redis import StrictRedis
from py.scwrypts import getenv
class RedisClient(StrictRedis):
def __init__(self):
super().__init__(
host = getenv('REDIS_HOST'),
port = getenv('REDIS_PORT'),
password = getenv('REDIS_AUTH', required=False),
decode_responses = True,
)
Client = RedisClient()