fix(bot): 🐛 Actually hang up calls with p.shutdown.
This commit is contained in:
@@ -294,12 +294,18 @@ class Mods(base.Cog):
|
|||||||
"⚡ Notified all channels of calls hang up. Flushing messages to the DB..."
|
"⚡ 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)
|
calls = await models.Call.filter(ended_at=None)
|
||||||
|
|
||||||
call_ids = [call.id for call in calls]
|
call_ids = [call.id for call in calls]
|
||||||
if call_ids:
|
if call_ids:
|
||||||
await redis.sadd(constants.CALL_IDS_TO_FLUSH, *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 self.bot.get_cog("Calls").flush_messages(True)
|
||||||
|
|
||||||
await tortoise.Tortoise.close_connections()
|
await tortoise.Tortoise.close_connections()
|
||||||
|
|||||||
Reference in New Issue
Block a user