feat: some stuff
This commit is contained in:
@@ -5,6 +5,7 @@ from datetime import datetime
|
||||
from redis import asyncio as aioredis
|
||||
|
||||
import backend.config
|
||||
from constants import APP_PATH
|
||||
|
||||
|
||||
class RedisConnectionManager:
|
||||
@@ -16,6 +17,13 @@ class RedisConnectionManager:
|
||||
async with cls._redis_lock:
|
||||
if cls._redis_connection is None:
|
||||
cls._redis_connection = await aioredis.from_url(backend.config.REDIS_URL)
|
||||
path = APP_PATH + "/redis.log"
|
||||
|
||||
with open(path, "a") as f:
|
||||
current_datetime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
line = f"[{current_datetime}] Created connection to redis\n"
|
||||
f.write(line)
|
||||
|
||||
return cls._redis_connection
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user