mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-10-06 18:29:33 +00:00

* Update build system to origin docker * Rename build env * fix lint p1 * fix bug & add more log info for snapshot/restore * fix exception * Log build info * revert last change * fix regex
21 lines
542 B
Python
21 lines
542 B
Python
"""HassIO docker utilitys."""
|
|
import logging
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
# pylint: disable=protected-access
|
|
def docker_process(method):
|
|
"""Wrap function with only run once."""
|
|
async def wrap_api(api, *args, **kwargs):
|
|
"""Return api wrapper."""
|
|
if api._lock.locked():
|
|
_LOGGER.error(
|
|
"Can't excute %s while a task is in progress", method.__name__)
|
|
return False
|
|
|
|
async with api._lock:
|
|
return await method(api, *args, **kwargs)
|
|
|
|
return wrap_api
|