11 lines
290 B
Python
11 lines
290 B
Python
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
|