Avoid tracking import executor jobs (#114453)
This commit is contained in:
parent
3b4958d972
commit
969b027a46
1 changed files with 5 additions and 5 deletions
|
@ -783,11 +783,11 @@ class HomeAssistant:
|
|||
def async_add_import_executor_job(
|
||||
self, target: Callable[[*_Ts], _T], *args: *_Ts
|
||||
) -> asyncio.Future[_T]:
|
||||
"""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)
|
||||
task.add_done_callback(self._tasks.remove)
|
||||
return task
|
||||
"""Add an import executor job from within the event loop.
|
||||
|
||||
The future returned from this method must be awaited in the event loop.
|
||||
"""
|
||||
return self.loop.run_in_executor(self.import_executor, target, *args)
|
||||
|
||||
@overload
|
||||
@callback
|
||||
|
|
Loading…
Add table
Reference in a new issue