Ivan Golikov
8266c95cd9
Reviewed-on: root/pssecret#3 Co-authored-by: Ivan Golikov <root@ivnglkv.me> Co-committed-by: Ivan Golikov <root@ivnglkv.me>
11 lines
349 B
Python
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))
|