From c0b9ef29618ec445869b52ca8930027a1d329d4c Mon Sep 17 00:00:00 2001 From: Matthias Blankertz Date: Sun, 7 Dec 2025 13:25:35 +0100 Subject: [PATCH] fix: timer: handle modifications to timers when _timer_worker is already scheduled correctly Signed-off-by: Matthias Blankertz --- software/src/utils/timer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/software/src/utils/timer.py b/software/src/utils/timer.py index 301a7e6..99d7552 100644 --- a/software/src/utils/timer.py +++ b/software/src/utils/timer.py @@ -73,7 +73,6 @@ class TimerManager(object): continue except asyncio.TimeoutError: pass - if len(self.timers) == 0: - continue - _, callback = heapq.heappop(self.timers) - safe_callback(callback, "timer callback") + else: + _, callback = heapq.heappop(self.timers) + safe_callback(callback, "timer callback")