keepalive_timeout

This commit is contained in:
AF 2022-12-26 20:59:56 +00:00
parent 03c90aedf3
commit afc8f3bfca

View File

@ -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)