Closes all db connections on worker recycle

This commit is contained in:
Ilan Steemers
2016-02-16 11:29:43 +01:00
parent 05d0663ef9
commit c66f0b74ed
+1
View File
@@ -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))