keepalive_timeout
This commit is contained in:
parent
03c90aedf3
commit
afc8f3bfca
@ -3,13 +3,16 @@ import signal
|
|||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
from v6d0auth.config import port, host
|
from v6d0auth.config import host, port
|
||||||
|
|
||||||
__all__ = ('start_app', 'run_app',)
|
__all__ = ('start_app', 'run_app',)
|
||||||
|
|
||||||
|
|
||||||
async def start_app(app: web.Application):
|
async def start_app(app: web.Application, keepalive_timeout=75.0):
|
||||||
runner = web.AppRunner(app)
|
runner = web.AppRunner(
|
||||||
|
app,
|
||||||
|
keepalive_timeout=keepalive_timeout,
|
||||||
|
)
|
||||||
await runner.setup()
|
await runner.setup()
|
||||||
site = web.TCPSite(runner, host=host, port=port)
|
site = web.TCPSite(runner, host=host, port=port)
|
||||||
await site.start()
|
await site.start()
|
||||||
@ -27,7 +30,10 @@ async def start_app(app: web.Application):
|
|||||||
signal.signal(signal.SIGTERM, sigtermed)
|
signal.signal(signal.SIGTERM, sigtermed)
|
||||||
|
|
||||||
|
|
||||||
async def run_app(app: web.Application):
|
async def run_app(app: web.Application, keepalive_timeout=75.0):
|
||||||
await start_app(app)
|
await start_app(
|
||||||
|
app,
|
||||||
|
keepalive_timeout=keepalive_timeout,
|
||||||
|
)
|
||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(3600)
|
await asyncio.sleep(3600)
|
||||||
|
Loading…
Reference in New Issue
Block a user