mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 06:38:11 +08:00
Adds timeout mechanism for workers
Workers now share a ctype with the sentinel to indicate if they are currently executing a task. This timer is incremented each guard loop until the worker resets it after finishing a job or until it reaches the TIMEOUT value and the worker is terminated by the sentinel.
This commit is contained in:
@@ -32,6 +32,9 @@ class Conf(object):
|
||||
# Number of tasks each worker can handle before it gets recycled. Useful for releasing memory
|
||||
RECYCLE = conf.get('recycle', 500)
|
||||
|
||||
# Number of seconds to wait for a worker to finish.
|
||||
TIMEOUT = conf.get('timeout', None)
|
||||
|
||||
# The Django Admin label for this app
|
||||
LABEL = conf.get('label', 'Django Q')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user