mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 09:58:12 +08:00
set exit timeout if no timeout is given
This commit is contained in:
+3
-1
@@ -275,8 +275,10 @@ class Sentinel(object):
|
|||||||
# Wait for the result queue to empty
|
# Wait for the result queue to empty
|
||||||
self.result_queue.join_thread()
|
self.result_queue.join_thread()
|
||||||
logger.info('{} waiting for the monitor.'.format(name))
|
logger.info('{} waiting for the monitor.'.format(name))
|
||||||
count = 0
|
|
||||||
# Wait for everything to close or time out
|
# Wait for everything to close or time out
|
||||||
|
count = 0
|
||||||
|
if not self.timeout:
|
||||||
|
self.timeout = 30
|
||||||
while self.status() == Conf.STOPPING and count < self.timeout * 5:
|
while self.status() == Conf.STOPPING and count < self.timeout * 5:
|
||||||
sleep(0.2)
|
sleep(0.2)
|
||||||
Stat(self).save()
|
Stat(self).save()
|
||||||
|
|||||||
@@ -103,6 +103,4 @@ LOGGING = {
|
|||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
# Django Q specific
|
# Django Q specific
|
||||||
Q_CLUSTER = {'name': 'django_q_test',
|
Q_CLUSTER = {'name': 'django_q_test'}
|
||||||
'timeout': 60,
|
|
||||||
'recycle': 100}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user