From 35fe4326a8b5e33343f0f4f7f6279995c0a2fa58 Mon Sep 17 00:00:00 2001 From: Mips2648 Date: Fri, 10 May 2024 17:27:57 +0200 Subject: [PATCH] try fix --- jeedomdaemon/base_daemon.py | 9 ++++++--- setup.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/jeedomdaemon/base_daemon.py b/jeedomdaemon/base_daemon.py index b71469c..21476a4 100644 --- a/jeedomdaemon/base_daemon.py +++ b/jeedomdaemon/base_daemon.py @@ -93,10 +93,13 @@ def stop(self): """ Stop your daemon if need be""" if self.__on_stop_cb is not None: - self._logger.info("create on stop callback task") + self._logger.debug("create on stop callback task") stop_task = asyncio.create_task(self.__on_stop_cb()) - asyncio.gather(stop_task) - self._logger.info("on stop callback task done") + try: + asyncio.gather(stop_task, return_exceptions=True) + except BaseException as e: # pylint: disable=broad-exception-caught + self._logger.warning("Some exception occured during cancellation: %s", e) + self._logger.debug("on stop callback task done") tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] tasks = asyncio.all_tasks() diff --git a/setup.py b/setup.py index ca052c0..f2626c2 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ # Needed for dependencies install_requires=['aiohttp'], # *strongly* suggested for sharing - version='0.8.2', + version='0.8.3', # The license can be anything you like license='MIT', description='A base to implement Jeedom daemon in python',