From d09c9b14a4bdf12c8c69b84e6eabc529e1442480 Mon Sep 17 00:00:00 2001 From: iceboy Date: Fri, 7 Apr 2017 19:32:28 -0700 Subject: [PATCH] update to aiohttp 2.0.6 --- requirements.txt | 2 +- vj4/server.py | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index cb16381d..31979263 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aiohttp>=2.0.5 +aiohttp>=2.0.6 jinja2>=2.9.0 # sockjs at head supports aiohttp 2.0, but not released yet. git+https://github.com/aio-libs/sockjs.git diff --git a/vj4/server.py b/vj4/server.py index 8f41eea5..2b86b21f 100644 --- a/vj4/server.py +++ b/vj4/server.py @@ -1,4 +1,3 @@ -import asyncio import atexit import logging import logging.config @@ -8,6 +7,7 @@ import sys import urllib.parse +from aiohttp import web from vj4 import app from vj4.util import options @@ -65,12 +65,7 @@ def main(): break else: atexit.register(lambda: os.kill(pid, signal.SIGTERM)) - loop = asyncio.get_event_loop() - loop.run_until_complete(loop.create_server(app.Application().make_handler(access_log=None, - lingering_time=0.0), - sock=sock)) - _logger.info('Server listening on %s', options.listen) - loop.run_forever() + web.run_app(app.Application(), sock=sock, access_log=None) if __name__ == '__main__': sys.exit(main())