fix: exceptions in callback should not terminate caller
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 4m46s
Check code formatting / Check-C-Format (push) Successful in 9s
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 13s

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
This commit is contained in:
2025-12-07 13:07:38 +01:00
parent 97e9742c75
commit e23f8bd34c
5 changed files with 22 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
import asyncio
import heapq
import time
from utils import safe_callback
TIMER_DEBUG = True
@@ -72,5 +73,7 @@ class TimerManager(object):
continue
except asyncio.TimeoutError:
pass
if len(self.timers) == 0:
continue
_, callback = heapq.heappop(self.timers)
callback()
safe_callback(callback, "timer callback")