feat(bot): ✨ Keep track of who reviewed each report.

This commit is contained in:
Nyeki.py
2024-10-27 16:53:05 -03:00
parent 6350f9db4f
commit 9e99211dda
5 changed files with 40 additions and 14 deletions
+13 -13
View File
@@ -1,5 +1,3 @@
import asyncio
from payphone.core import logging
@@ -30,10 +28,10 @@ async def flush():
call_ids = [int(call_id) for call_id in call_ids]
if len(call_ids) == 0:
log.info("Skipping flushing. No calls to 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()
@@ -81,8 +79,8 @@ async def flush():
asyncpg.exceptions.InterfaceError,
):
log.exception(
"[Call ID: %s] An error occured trying to flush messages for call ID."
% call_id
"[Call ID: %s] An error occured trying to flush messages for call ID.",
call_id,
)
continue
@@ -98,14 +96,16 @@ async def flush():
asyncpg.exceptions.InterfaceError,
):
log.exception(
"[Call ID: %s] An error occured trying to flush message contents."
% call_id
"[Call ID: %s] An error occured trying to flush message contents.",
call_id,
)
continue
log.info(
"[Call ID: %s] Flushed %s messages and %s message contents."
% (call_id, len(messages), len(message_contents))
log.debug(
"[Call ID: %s] Flushed %s messages and %s message contents.",
call_id,
len(messages),
len(message_contents),
)
log.info("Finished flushing messages.")
@@ -126,5 +126,5 @@ async def loop() -> None:
await flush()
except (KeyboardInterrupt, asyncio.exceptions.CancelledError) as e:
log.exception('')
except (KeyboardInterrupt, asyncio.exceptions.CancelledError):
log.exception("")