Skip to content

Commit

Permalink
Wrap coroutine in a task before passing to asyncio.wait
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Jan 26, 2023
1 parent 2160b2e commit c04f719
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qrexec/tools/qrexec_policy_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def main():

loop = asyncio.get_event_loop()
tasks = [
agent.run(),
asyncio.create_task(agent.run()),
]
loop.run_until_complete(asyncio.wait(tasks))

Expand Down
2 changes: 1 addition & 1 deletion qrexec/tools/qrexec_policy_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ async def start_serving(args=None):

await asyncio.wait(
[
server.serve_forever()
asyncio.create_task(server.serve_forever())
for server in (policy_server, eval_server, gui_eval_server)
]
)
Expand Down

0 comments on commit c04f719

Please sign in to comment.