mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
19 lines
403 B
Python
19 lines
403 B
Python
import redis.asyncio as redis
|
|
|
|
from app.config import settings as global_settings
|
|
|
|
|
|
async def get_redis():
|
|
return await redis.from_url(
|
|
global_settings.redis_url.unicode_string(),
|
|
encoding="utf-8",
|
|
decode_responses=True,
|
|
)
|
|
|
|
|
|
async def get_cache():
|
|
return await redis.from_url(
|
|
global_settings.redis_url.unicode_string(),
|
|
decode_responses=False,
|
|
)
|