From 6349177a1457f445836dfbcd33c7376500aea73a Mon Sep 17 00:00:00 2001 From: ualex73 Date: Sat, 11 Dec 2021 13:37:08 +0100 Subject: [PATCH] Trying to make docker connection more robust --- custom_components/monitor_docker/helpers.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/custom_components/monitor_docker/helpers.py b/custom_components/monitor_docker/helpers.py index 41acc98..ca86508 100644 --- a/custom_components/monitor_docker/helpers.py +++ b/custom_components/monitor_docker/helpers.py @@ -65,7 +65,7 @@ PRECISION, ) -VERSION = "1.14b1" +VERSION = "1.14b2" _LOGGER = logging.getLogger(__name__) @@ -762,9 +762,14 @@ async def _run(self): self._name, ) - await asyncio.sleep(self._interval) except concurrent.futures._base.CancelledError: + _LOGGER.debug( + "[%s] %s: Container received concurrent.futures._base.CancelledError", + self._instance, + self._name, + ) pass + break except Exception as err: _LOGGER.error( "[%s] %s: Container not available anymore (3) (%s)", @@ -774,6 +779,9 @@ async def _run(self): exc_info=True, ) + # Sleep in normal and exception situation + await asyncio.sleep(self._interval) + ############################################################# async def _run_container_info(self): """Get container information, but we can not get