Spaces:
Runtime error
Runtime error
Refactor Dockerfile and clean up unused schemas; update Redis client initialization and environment configuration
a3aa6c1 Download src/utils/_redis_client.py from sifars/keepme-backend: direct link, hf CLI and curl.
- Browser
- Download file 349 Bytes
-
https://huggingface.co/spaces/sifars/keepme-backend/resolve/main/src/utils/_redis_client.py
- Command line
-
hf download hf://spaces/sifars/keepme-backend/src/utils/_redis_client.py
-
curl -L -o _redis_client.py https://huggingface.co/spaces/sifars/keepme-backend/resolve/main/src/utils/_redis_client.py
349 Bytes
| import os | |
| import redis.asyncio as redis | |
| class RedisClient: | |
| def __init__(self): | |
| self.redis_url = os.getenv("REDIS_URI") | |
| self.client = self.init_redis() | |
| def init_redis(self): | |
| redis_client = redis.from_url( | |
| url=self.redis_url, encoding="utf-8", decode_responses=True | |
| ) | |
| return redis_client | |