fix: timer: handle modifications to timers when _timer_worker is already scheduled correctly
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 4m45s
Check code formatting / Check-C-Format (push) Successful in 8s
Check code formatting / Check-Python-Flake8 (push) Successful in 11s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 6s
Run unit tests on host / Run-Unit-Tests (push) Successful in 10s
Run pytests / Check-Pytest (push) Successful in 12s

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
This commit is contained in:
2025-12-07 13:25:35 +01:00
parent e23f8bd34c
commit c0b9ef2961

View File

@@ -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")