Skip to content

Commit

Permalink
🎨 log stack trace when removing task from task manager (ITISFoundatio…
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis authored Mar 11, 2024
1 parent b9020f8 commit b7c59f0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,12 @@ async def remove_task(
reraise_errors: bool = True,
) -> None:
"""cancels and removes task"""
logger.debug(
"Attempting to remove task with task_id=%s.", task_id, exc_info=True
)
try:
tracked_task = self._get_tracked_task(task_id, with_task_context)
logger.debug("Succeeded in getting task with task_id=%s", task_id)
except TaskNotFoundError:
if reraise_errors:
raise
Expand All @@ -326,8 +330,10 @@ async def remove_task(
await self._cancel_tracked_task(
tracked_task.task, task_id, reraise_errors=reraise_errors
)
logger.debug("Succeeded in canceling task with task_id=%s", task_id)
finally:
del self._tasks_groups[tracked_task.task_name][task_id]
logger.debug("Removed task_id=%s from tracked tasks", task_id)

async def close(self) -> None:
"""
Expand Down

0 comments on commit b7c59f0

Please sign in to comment.