mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Tweak block_till_done (#4245)
This commit is contained in:
parent
7774a03a55
commit
98f41d6b84
@ -252,8 +252,9 @@ class HomeAssistant(object):
|
||||
"""Block till all pending work is done."""
|
||||
while True:
|
||||
# Wait for the pending tasks are down
|
||||
if len(self._pending_tasks) > 0:
|
||||
yield from asyncio.wait(self._pending_tasks, loop=self.loop)
|
||||
pending = list(self._pending_tasks)
|
||||
if len(pending) > 0:
|
||||
yield from asyncio.wait(pending, loop=self.loop)
|
||||
|
||||
# Verify the loop is empty
|
||||
ret = yield from self.loop.run_in_executor(None, self._loop_empty)
|
||||
|
Loading…
x
Reference in New Issue
Block a user