diff --git a/django_q/cluster.py b/django_q/cluster.py index da7c35a..0b853ed 100644 --- a/django_q/cluster.py +++ b/django_q/cluster.py @@ -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))