pssecret-server/pssecret_server/redis_db.py

12 lines
356 B
Python
Raw Permalink Normal View History

2022-12-17 08:53:50 +00:00
# noinspection PyUnresolvedReferences,PyProtectedMember
from typing import Annotated
from fastapi import Depends
2022-12-17 08:53:50 +00:00
from redis import asyncio as aioredis
2025-01-01 19:01:10 +00:00
from pssecret_server.settings import Settings, get_settings
2022-12-17 08:53:50 +00:00
def get_redis(settings: Annotated[Settings, Depends(get_settings)]) -> aioredis.Redis:
return aioredis.from_url(str(settings.redis_url))