Skip to content

Commit 456c9da

Browse files
committed
make AppRunner parameters available in run_app()
1 parent e260b15 commit 456c9da

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

aiohttp/web.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from .abc import AbstractAccessLogger
1414
from .helpers import AppKey
15-
from .log import access_logger
15+
from .log import access_logger, server_logger
1616
from .typedefs import PathLike
1717
from .web_app import Application, CleanupError
1818
from .web_exceptions import (
@@ -277,35 +277,20 @@ async def _run_app(
277277
port: int | None = None,
278278
path: PathLike | TypingIterable[PathLike] | None = None,
279279
sock: socket.socket | TypingIterable[socket.socket] | None = None,
280-
shutdown_timeout: float = 60.0,
281-
keepalive_timeout: float = 75.0,
282280
ssl_context: SSLContext | None = None,
283281
print: Callable[..., None] | None = print,
284282
backlog: int = 128,
285-
access_log_class: type[AbstractAccessLogger] = AccessLogger,
286-
access_log_format: str = AccessLogger.LOG_FORMAT,
287-
access_log: logging.Logger | None = access_logger,
288-
handle_signals: bool = True,
289283
reuse_address: bool | None = None,
290284
reuse_port: bool | None = None,
291-
handler_cancellation: bool = False,
285+
**kwargs: Any,
292286
) -> None:
293287
# An internal function to actually do all dirty job for application running
294288
if asyncio.iscoroutine(app):
295289
app = await app
296290

297291
app = cast(Application, app)
298292

299-
runner = AppRunner(
300-
app,
301-
handle_signals=handle_signals,
302-
access_log_class=access_log_class,
303-
access_log_format=access_log_format,
304-
access_log=access_log,
305-
keepalive_timeout=keepalive_timeout,
306-
shutdown_timeout=shutdown_timeout,
307-
handler_cancellation=handler_cancellation,
308-
)
293+
runner = AppRunner(app, **kwargs)
309294

310295
await runner.setup()
311296

@@ -453,6 +438,7 @@ def run_app(
453438
reuse_port: bool | None = None,
454439
handler_cancellation: bool = False,
455440
loop: asyncio.AbstractEventLoop | None = None,
441+
**kwargs: Any,
456442
) -> None:
457443
"""Run an app locally"""
458444
if loop is None:
@@ -485,6 +471,7 @@ def run_app(
485471
reuse_address=reuse_address,
486472
reuse_port=reuse_port,
487473
handler_cancellation=handler_cancellation,
474+
**kwargs,
488475
)
489476
)
490477

0 commit comments

Comments
 (0)