fix(bot): 🚑 Migrate to serverless redis.

This commit is contained in:
Nyeki.py
2024-11-03 22:59:14 -03:00
parent 07c6b829bc
commit 7b310a2110
8 changed files with 157 additions and 77 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ async def flush():
import asyncpg.exceptions
import redis.asyncio as aredis
import upstash_redis.asyncio as aredis
from payphone.db import models
@@ -31,7 +31,7 @@ async def flush():
log.debug("Skipping flushing. No calls to flush.")
return
log.info("Flushing messages for %s calls." , len(call_ids))
log.info("Flushing messages for %s calls.", len(call_ids))
pipe = redis.pipeline()
@@ -65,7 +65,7 @@ async def flush():
constants.CALL_MESSAGE_FROM_PROPAGATION_TEMPLATE % call_id,
constants.CALL_MESSAGES_TEMPLATE % call_id,
constants.CALL_MESSAGE_REPLIES_TEMPLATE % call_id,
constants.CALL_IS_ACTIVE % call_id
constants.CALL_IS_ACTIVE % call_id,
)
await pipe.execute()