Skip to content

Commit

Permalink
set exit timeout if no timeout is given
Browse files Browse the repository at this point in the history
  • Loading branch information
Koed00 committed Jul 7, 2015
1 parent 2b3c29b commit 729abaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion django_q/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ def stop(self):
# Wait for the result queue to empty
self.result_queue.join_thread()
logger.info('{} waiting for the monitor.'.format(name))
count = 0
# 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:
sleep(0.2)
Stat(self).save()
Expand Down
4 changes: 1 addition & 3 deletions django_q/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,4 @@
STATIC_URL = '/static/'

# Django Q specific
Q_CLUSTER = {'name': 'django_q_test',
'timeout': 60,
'recycle': 100}
Q_CLUSTER = {'name': 'django_q_test'}

0 comments on commit 729abaf

Please sign in to comment.