From afc8f3bfcab788817096918a6b591136864997b3 Mon Sep 17 00:00:00 2001 From: timofey Date: Mon, 26 Dec 2022 20:59:56 +0000 Subject: [PATCH] keepalive_timeout --- v6d0auth/run_app.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/v6d0auth/run_app.py b/v6d0auth/run_app.py index 0f6f4c4..585e0c4 100644 --- a/v6d0auth/run_app.py +++ b/v6d0auth/run_app.py @@ -3,13 +3,16 @@ import signal from aiohttp import web -from v6d0auth.config import port, host +from v6d0auth.config import host, port __all__ = ('start_app', 'run_app',) -async def start_app(app: web.Application): - runner = web.AppRunner(app) +async def start_app(app: web.Application, keepalive_timeout=75.0): + runner = web.AppRunner( + app, + keepalive_timeout=keepalive_timeout, + ) await runner.setup() site = web.TCPSite(runner, host=host, port=port) await site.start() @@ -27,7 +30,10 @@ async def start_app(app: web.Application): signal.signal(signal.SIGTERM, sigtermed) -async def run_app(app: web.Application): - await start_app(app) +async def run_app(app: web.Application, keepalive_timeout=75.0): + await start_app( + app, + keepalive_timeout=keepalive_timeout, + ) while True: await asyncio.sleep(3600)