mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +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."""
|
"""Block till all pending work is done."""
|
||||||
while True:
|
while True:
|
||||||
# Wait for the pending tasks are down
|
# Wait for the pending tasks are down
|
||||||
if len(self._pending_tasks) > 0:
|
pending = list(self._pending_tasks)
|
||||||
yield from asyncio.wait(self._pending_tasks, loop=self.loop)
|
if len(pending) > 0:
|
||||||
|
yield from asyncio.wait(pending, loop=self.loop)
|
||||||
|
|
||||||
# Verify the loop is empty
|
# Verify the loop is empty
|
||||||
ret = yield from self.loop.run_in_executor(None, self._loop_empty)
|
ret = yield from self.loop.run_in_executor(None, self._loop_empty)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user