mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Avoid tracking import executor jobs (#114453)
This commit is contained in:
parent
3b4958d972
commit
969b027a46
@ -783,11 +783,11 @@ class HomeAssistant:
|
|||||||
def async_add_import_executor_job(
|
def async_add_import_executor_job(
|
||||||
self, target: Callable[[*_Ts], _T], *args: *_Ts
|
self, target: Callable[[*_Ts], _T], *args: *_Ts
|
||||||
) -> asyncio.Future[_T]:
|
) -> asyncio.Future[_T]:
|
||||||
"""Add an import executor job from within the event loop."""
|
"""Add an import executor job from within the event loop.
|
||||||
task = self.loop.run_in_executor(self.import_executor, target, *args)
|
|
||||||
self._tasks.add(task)
|
The future returned from this method must be awaited in the event loop.
|
||||||
task.add_done_callback(self._tasks.remove)
|
"""
|
||||||
return task
|
return self.loop.run_in_executor(self.import_executor, target, *args)
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
@callback
|
@callback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user