16 lines
279 B
Python
16 lines
279 B
Python
from redis.asyncio import Redis
|
|
|
|
from app.config import get_settings
|
|
|
|
|
|
settings = get_settings()
|
|
|
|
|
|
def prefixed_key(key: str) -> str:
|
|
return f"{settings.redis_key_prefix}{key}"
|
|
|
|
|
|
def get_redis() -> Redis:
|
|
return Redis.from_url(settings.redis_url, decode_responses=True)
|
|
|