mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-25 18:38:11 +08:00
Closes all db connections on worker recycle
This commit is contained in:
@@ -388,6 +388,7 @@ def worker(task_queue, result_queue, timer, timeout=Conf.TIMEOUT):
|
||||
timer.value = -1 # Idle
|
||||
# Recycle
|
||||
if task_count == Conf.RECYCLE:
|
||||
db.connections.close_all() # Close any active connections
|
||||
timer.value = -2 # Recycled
|
||||
break
|
||||
logger.info(_('{} stopped doing work').format(name))
|
||||
|
||||
Reference in New Issue
Block a user