import redis from app.core.config import settings class MyRedis: def __init__(self) -> None: self._host = settings.REDIS_HOST self._port = settings.REDIS_PORT self._db = settings.REDIS_DB self._password = settings.REDIS_PASSWORD def get_client(self) -> redis.Redis: return redis.Redis( host=self._host, port=self._port, db=self._db, password=self._password )