redis & listening works!!
This commit is contained in:
10
backend/app/db/redis.py
Normal file
10
backend/app/db/redis.py
Normal file
@ -0,0 +1,10 @@
|
||||
import redis
|
||||
import os
|
||||
|
||||
REDIS_HOST = os.environ.get("REDIS_HOST", "redis")
|
||||
REDIS_PORT = int(os.environ.get("REDIS_PORT", "6379"))
|
||||
|
||||
|
||||
async def create_redis() -> redis.Redis:
|
||||
redis_connection = await redis.asyncio.Redis(host=REDIS_HOST, port=REDIS_PORT, db=0)
|
||||
return redis_connection
|
||||
Reference in New Issue
Block a user