fix (schedule): Fix potential deadlock.

This commit is contained in:
2023-07-08 09:30:10 +03:00
parent 043f358f57
commit d4154c5ce2
2 changed files with 12 additions and 4 deletions

View File

@@ -178,6 +178,7 @@ class TimeSlot:
now = utc_now()
tracker = self.bot.get_cog('VoiceTrackerCog')
tracking_lock = tracker.tracking_lock
sessions.sort(key=lambda s: s.guildid)
session_locks = [session.lock for session in sessions]
# Take the tracking lock so that sessions are not started/finished while we reset the clock