mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-23 09:06:29 +00:00
Catch exception on watchdog for pretty log (#778)
* Catch exception on watchdog for pretty log * Update tasks.py
This commit is contained in:
parent
fb12fee59b
commit
d3b4a03851
@ -3,6 +3,7 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from .coresys import CoreSysAttributes
|
from .coresys import CoreSysAttributes
|
||||||
|
from .exceptions import HomeAssistantError
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -104,7 +105,10 @@ class Tasks(CoreSysAttributes):
|
|||||||
return
|
return
|
||||||
|
|
||||||
_LOGGER.warning("Watchdog found a problem with Home Assistant Docker!")
|
_LOGGER.warning("Watchdog found a problem with Home Assistant Docker!")
|
||||||
|
try:
|
||||||
await self.sys_homeassistant.start()
|
await self.sys_homeassistant.start()
|
||||||
|
except HomeAssistantError:
|
||||||
|
_LOGGER.error("Watchdog Home Assistant reanimation fails!")
|
||||||
|
|
||||||
async def _watchdog_homeassistant_api(self):
|
async def _watchdog_homeassistant_api(self):
|
||||||
"""Create scheduler task for monitoring running state of API.
|
"""Create scheduler task for monitoring running state of API.
|
||||||
@ -136,6 +140,8 @@ class Tasks(CoreSysAttributes):
|
|||||||
_LOGGER.error("Watchdog found a problem with Home Assistant API!")
|
_LOGGER.error("Watchdog found a problem with Home Assistant API!")
|
||||||
try:
|
try:
|
||||||
await self.sys_homeassistant.restart()
|
await self.sys_homeassistant.restart()
|
||||||
|
except HomeAssistantError:
|
||||||
|
_LOGGER.error("Watchdog Home Assistant reanimation fails!")
|
||||||
finally:
|
finally:
|
||||||
self._cache[HASS_WATCHDOG_API] = 0
|
self._cache[HASS_WATCHDOG_API] = 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user