Migrate timer status to enum instead of int

This commit is contained in:
Stan
2026-08-13 16:53:42 +02:00
parent 97ea3c89a5
commit a8f3bfb832
6 changed files with 46 additions and 23 deletions
+14
View File
@@ -0,0 +1,14 @@
from enum import IntEnum
class TimerStatus(IntEnum):
"""
Sentinel values for the countdown timer a worker shares with the sentinel.
Any positive value is the number of seconds left before the sentinel
considers the task timed out and reincarnates the worker.
"""
TIMEOUT = 0 # task timed out, the worker has to be terminated
IDLE = -1 # waiting for work, or working without a timeout
RECYCLED = -2 # recycle limit reached, the worker stopped on its own