We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e67226 commit 76b5eadCopy full SHA for 76b5ead
buildingmotif/ingresses/bacnet.py
@@ -64,6 +64,13 @@ def _run_async(self, coro):
64
try:
65
asyncio.set_event_loop(loop)
66
loop.run_until_complete(coro)
67
+ pending = [task for task in asyncio.all_tasks(loop) if not task.done()]
68
+ if pending:
69
+ for task in pending:
70
+ task.cancel()
71
+ loop.run_until_complete(
72
+ asyncio.gather(*pending, return_exceptions=True)
73
+ )
74
loop.run_until_complete(loop.shutdown_asyncgens())
75
finally:
76
asyncio.set_event_loop(None)
0 commit comments