fix(bot): 🐛 Actually hang up calls with p.shutdown.

This commit is contained in:
Nyeki.py
2024-10-23 15:36:48 -03:00
parent 5375ae4e95
commit c056709332
+6
View File
@@ -294,12 +294,18 @@ class Mods(base.Cog):
"⚡ Notified all channels of calls hang up. Flushing messages to the DB..."
)
await redis.delete(constants.CHANNELS_ONCALL_SET)
calls = await models.Call.filter(ended_at=None)
call_ids = [call.id for call in calls]
if call_ids:
await redis.sadd(constants.CALL_IDS_TO_FLUSH, *call_ids)
await models.Call.filter(ended_at=None).update(
ended_at=datetime.now(timezone.utc)
)
await self.bot.get_cog("Calls").flush_messages(True)
await tortoise.Tortoise.close_connections()