We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85f30f5 commit 57587abCopy full SHA for 57587ab
api/task_processor/threads.py
@@ -1,8 +1,8 @@
1
import logging
2
import time
3
-import traceback
4
from threading import Thread
5
+from django.db import close_old_connections
6
from django.utils import timezone
7
8
from task_processor.processor import run_recurring_tasks, run_tasks
@@ -42,8 +42,8 @@ def run_iteration(self) -> None:
42
# TODO: is this also what is causing tasks to get stuck as locked? Can we unlock
43
# tasks here?
44
45
- logger.error("Received error retrieving tasks: %s.", e)
46
- logger.debug(traceback.format_exc())
+ logger.error("Received error retrieving tasks: %s.", e, exc_info=e)
+ close_old_connections()
47
48
def stop(self):
49
self._stopped = True
0 commit comments