From f4bc0efc319791ee9e62c254543e3629c08b3e15 Mon Sep 17 00:00:00 2001 From: Jeremie Pardou-Piquemal <571533+jrmi@users.noreply.github.com> Date: Mon, 15 Apr 2019 22:18:35 +0200 Subject: [PATCH] Fix #1551 missing parameter in create_server --- docs/sanic/deploying.md | 2 +- examples/log_request_id.py | 2 +- examples/run_async.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sanic/deploying.md b/docs/sanic/deploying.md index 23dc28b6..15642f6d 100644 --- a/docs/sanic/deploying.md +++ b/docs/sanic/deploying.md @@ -92,7 +92,7 @@ to run the app in general. Here is an incomplete example (please see `run_async.py` in examples for something more practical): ```python -server = app.create_server(host="0.0.0.0", port=8000) +server = app.create_server(host="0.0.0.0", port=8000, return_asyncio_server=True) loop = asyncio.get_event_loop() task = asyncio.ensure_future(server) loop.run_forever() diff --git a/examples/log_request_id.py b/examples/log_request_id.py index a6dba418..687d79da 100644 --- a/examples/log_request_id.py +++ b/examples/log_request_id.py @@ -76,7 +76,7 @@ async def test(request): if __name__ == '__main__': asyncio.set_event_loop(uvloop.new_event_loop()) - server = app.create_server(host="0.0.0.0", port=8000) + server = app.create_server(host="0.0.0.0", port=8000, return_asyncio_server=True) loop = asyncio.get_event_loop() loop.set_task_factory(context.task_factory) task = asyncio.ensure_future(server) diff --git a/examples/run_async.py b/examples/run_async.py index 3d8ab55a..c35da8b1 100644 --- a/examples/run_async.py +++ b/examples/run_async.py @@ -12,7 +12,7 @@ async def test(request): return response.json({"answer": "42"}) asyncio.set_event_loop(uvloop.new_event_loop()) -server = app.create_server(host="0.0.0.0", port=8000) +server = app.create_server(host="0.0.0.0", port=8000, return_asyncio_server=True) loop = asyncio.get_event_loop() task = asyncio.ensure_future(server) signal(SIGINT, lambda s, f: loop.stop())