feat(bot): ✨ Flush all messages to DB on call hangup.

This commit is contained in:
Nyeki.py
2024-10-20 21:51:48 -03:00
parent e3c58139d2
commit 6fbb65507f
5 changed files with 172 additions and 93 deletions
+19
View File
@@ -173,6 +173,25 @@ CHANNELS_ONCALL_SET = "channels:on-call"
MESSAGES_QUEUE = "messages"
MESSAGE_CONTENTS_QUEUE = "message-contents"
MESSAGES_PROPAGATION_MAP = "messages-propagation"
CALL_MESSAGES_TEMPLATE = "m:%s"
"""`%s`: Call ID. The key template for call messages hash."""
CALL_MESSAGE_CONTENTS_TEMPLATE = "mc:%s"
"""`%s`: Call ID. The key template for call message contents hash."""
CALL_MESSAGE_CONTENTS_HASH_TEMPLATE = "%s-%s"
"""`%s-%s`: Call ID - Iteration. The key template for call message contents hash keys."""
CALL_MESSAGE_FROM_PROPAGATION_TEMPLATE = "mfp:%s"
"""`%s`: Call ID. A map from propagation IDs to message IDs."""
CALL_MESSAGE_CONTENT_ITERATIONS_TEMPLATE = "mci:%s"
"""`%s`: Call ID. A map of messages to amount of iterations of their message contents."""
CALL_IDS_TO_FLUSH = "call-ids-to-flush"
"""A set of IDs of calls to flush to the DB."""
BAN_TEMPLATE = "b:%s"
PREFIX_TEMPLATE = "p:%s"