Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mips2648 committed May 10, 2024
1 parent 0960496 commit 35fe432
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions jeedomdaemon/base_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 35fe432

Please sign in to comment.