Skip to content

Commit a9744ae

Browse files
authored
Merge pull request #102 from raix/issue/9-async-executory-wait-for-pending-futures
Async executor "wait for pending futures"
2 parents dadb918 + 3acd71d commit a9744ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graphql/execution/executors/asyncio.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ def __init__(self, loop=None):
3838

3939
def wait_until_finished(self):
4040
# if there are futures to wait for
41-
if self.futures:
41+
while self.futures:
4242
# wait for the futures to finish
43-
self.loop.run_until_complete(wait(self.futures))
43+
futures = self.futures
44+
self.futures = []
45+
self.loop.run_until_complete(wait(futures))
4446

4547
def execute(self, fn, *args, **kwargs):
4648
result = fn(*args, **kwargs)

0 commit comments

Comments
 (0)