mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-10 17:00:55 +08:00
Migrate timer status to enum instead of int
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user