We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39ceb97 commit 5671bbbCopy full SHA for 5671bbb
django_tasks/backends/database/management/commands/db_worker.py
@@ -8,6 +8,7 @@
8
from typing import List, Optional
9
10
from django.core.management.base import BaseCommand
11
+from django.db import connections
12
from django.db.utils import OperationalError
13
14
from django_tasks import DEFAULT_TASK_BACKEND_ALIAS, tasks
@@ -97,6 +98,9 @@ def start(self) -> None:
97
98
finally:
99
self.running_task = False
100
101
+ for conn in connections.all(initialized_only=True):
102
+ conn.close()
103
+
104
if self.batch and task_result is None:
105
# If we're running in "batch" mode, terminate the loop (and thus the worker)
106
return None
0 commit comments