Skip to content

Commit 99bc3a8

Browse files
committed
Cleaner iterable op running
1 parent 187ee78 commit 99bc3a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graphql_ws/django/subscriptions.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ async def on_start(self, connection_context, op_id, params):
7171
await self.on_operation_complete(connection_context, op_id)
7272
return
7373

74-
iterator = await execution_result.__aiter__()
75-
task = asyncio.ensure_future(self.run_op(connection_context, op_id, iterator))
74+
task = asyncio.ensure_future(
75+
self.run_op(connection_context, op_id, execution_result)
76+
)
7677
connection_context.register_operation(op_id, task)
7778

78-
async def run_op(self, connection_context, op_id, iterator):
79-
async for single_result in iterator:
79+
async def run_op(self, connection_context, op_id, aiterable):
80+
async for single_result in aiterable:
8081
if not connection_context.has_operation(op_id):
8182
break
8283
await self.send_execution_result(connection_context, op_id, single_result)

0 commit comments

Comments
 (0)