Skip to content

Commit

Permalink
fix: Stale connections after task processor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 committed Jun 18, 2024
1 parent d2e156e commit ac41552
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/task_processor/threads.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging
import time
import traceback
from threading import Thread

from django.db import close_old_connections
from django.utils import timezone

from task_processor.processor import run_recurring_tasks, run_tasks
Expand Down Expand Up @@ -42,8 +42,8 @@ def run_iteration(self) -> None:
# TODO: is this also what is causing tasks to get stuck as locked? Can we unlock
# tasks here?

logger.error("Received error retrieving tasks: %s.", e)
logger.debug(traceback.format_exc())
logger.error("Received error retrieving tasks: %s.", e, exc_info=e)
close_old_connections()

def stop(self):
self._stopped = True

0 comments on commit ac41552

Please sign in to comment.