2022-12-17 08:53:50 +00:00
|
|
|
# noinspection PyUnresolvedReferences,PyProtectedMember
|
2025-01-01 18:18:38 +00:00
|
|
|
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
|
2025-01-01 18:18:38 +00:00
|
|
|
|
2022-12-17 08:53:50 +00:00
|
|
|
|
2025-01-01 18:18:38 +00:00
|
|
|
def get_redis(settings: Annotated[Settings, Depends(get_settings)]) -> aioredis.Redis:
|
|
|
|
return aioredis.from_url(str(settings.redis_url))
|