pssecret-server/pssecret/redis_db.py
2025-01-01 19:01:26 +01:00

11 lines
349 B
Python

# noinspection PyUnresolvedReferences,PyProtectedMember
from typing import Annotated
from fastapi import Depends
from redis import asyncio as aioredis
from pssecret.settings import Settings, get_settings
def get_redis(settings: Annotated[Settings, Depends(get_settings)]) -> aioredis.Redis:
return aioredis.from_url(str(settings.redis_url))