Skip to content

Commit

Permalink
fix: demote log errors on exit to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Feb 2, 2024
1 parent 09a070f commit a386c65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions horde_worker_regen/process_management/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2439,8 +2439,7 @@ async def _bridge_data_loop(self) -> None:
except CancelledError:
self._shutting_down = True

@staticmethod
def _handle_exception(future: asyncio.Future) -> None:
def _handle_exception(self, future: asyncio.Future) -> None:
"""
Logs exceptions from asyncio tasks.
Expand All @@ -2449,7 +2448,10 @@ def _handle_exception(future: asyncio.Future) -> None:
"""
ex = future.exception()
if ex is not None:
logger.error(f"exception thrown by a main loop task: {ex}")
if self._shutting_down:
logger.debug(f"exception thrown by a main loop task: {ex}")
else:
logger.error(f"exception thrown by a main loop task: {ex}")

async def _main_loop(self) -> None:
# Run both loops concurrently
Expand Down

0 comments on commit a386c65

Please sign in to comment.