Spaces:
Runtime error
Runtime error
| import os | |
| from functools import lru_cache | |
| from pydantic_redis import RedisConfig | |
| from redis import Redis | |
| host = os.environ.get("REDIS_HOST", "localhost") | |
| port = int(os.environ.get("REDIS_PORT", 6379)) | |
| password = os.environ.get("REDIS_PASSWORD", None) | |
| ssl = True if os.environ.get("REDIS_SSL") else False | |
| def get_redis_client(): | |
| return Redis(host=host, port=port, password=password, ssl=ssl) | |
| def get_redis_config(): | |
| return RedisConfig(host=host, port=port, password=password, ssl=ssl) | |