Skip to content

Commit

Permalink
Fix trio with multiple workers
Browse files Browse the repository at this point in the history
The `shutdown_trigger` argument of `worker_serve` needs to be a callable returning an awaitable, not an awaitable directly.
  • Loading branch information
miracle2k committed Mar 2, 2020
1 parent b062659 commit 4b614d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hypercorn/trio/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ def trio_worker(

shutdown_trigger = None
if shutdown_event is not None:
shutdown_trigger = check_multiprocess_shutdown_event(shutdown_event, trio.sleep)
shutdown_trigger = partial(check_multiprocess_shutdown_event, shutdown_event, trio.sleep)

trio.run(partial(worker_serve, app, config, sockets=sockets, shutdown_trigger=shutdown_trigger))

0 comments on commit 4b614d8

Please sign in to comment.