mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 09:08: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
|
timer.value = -1 # Idle
|
||||||
# Recycle
|
# Recycle
|
||||||
if task_count == Conf.RECYCLE:
|
if task_count == Conf.RECYCLE:
|
||||||
|
db.connections.close_all() # Close any active connections
|
||||||
timer.value = -2 # Recycled
|
timer.value = -2 # Recycled
|
||||||
break
|
break
|
||||||
logger.info(_('{} stopped doing work').format(name))
|
logger.info(_('{} stopped doing work').format(name))
|
||||||
|
|||||||
Reference in New Issue
Block a user