mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
add auth and redis endpoints
This commit is contained in:
14
app/redis.py
Normal file
14
app/redis.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import redis.asyncio as redis
|
||||
|
||||
from app import config
|
||||
|
||||
|
||||
global_settings = config.get_settings()
|
||||
|
||||
|
||||
async def get_redis():
|
||||
return await redis.from_url(
|
||||
global_settings.redis_url.unicode_string(),
|
||||
encoding="utf-8",
|
||||
decode_responses=True,
|
||||
)
|
||||
Reference in New Issue
Block a user