mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-06-25 11:26:30 +00:00
Fix remove data inside executor (#576)
This commit is contained in:
parent
029f277945
commit
3aa4cdf540
@ -856,12 +856,12 @@ class Addon(CoreSysAttributes):
|
|||||||
# restore data
|
# restore data
|
||||||
def _restore_data():
|
def _restore_data():
|
||||||
"""Restore data."""
|
"""Restore data."""
|
||||||
if self.path_data.is_dir():
|
|
||||||
await remove_data(self.path_data)
|
|
||||||
shutil.copytree(str(Path(temp, "data")), str(self.path_data))
|
shutil.copytree(str(Path(temp, "data")), str(self.path_data))
|
||||||
|
|
||||||
|
_LOGGER.info("Restore data for addon %s", self._id)
|
||||||
|
if self.path_data.is_dir():
|
||||||
|
await remove_data(self.path_data)
|
||||||
try:
|
try:
|
||||||
_LOGGER.info("Restore data for addon %s", self._id)
|
|
||||||
await self.sys_run_in_executor(_restore_data)
|
await self.sys_run_in_executor(_restore_data)
|
||||||
except shutil.Error as err:
|
except shutil.Error as err:
|
||||||
_LOGGER.error("Can't restore origin data: %s", err)
|
_LOGGER.error("Can't restore origin data: %s", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user