18 lines
368 B
Python
18 lines
368 B
Python
from redis.asyncio import Redis
|
|
from .config import get_settings
|
|
|
|
|
|
settings = get_settings()
|
|
|
|
# Async redis client for FastAPI/Async services
|
|
redis_client = Redis(
|
|
host=settings.redis_host,
|
|
port=settings.redis_port,
|
|
db=settings.redis_db,
|
|
password=settings.redis_password,
|
|
decode_responses=True,
|
|
)
|
|
|
|
def get_redis() -> Redis:
|
|
return redis_client
|