|
12 | 12 |
|
13 | 13 | from .abc import AbstractAccessLogger |
14 | 14 | from .helpers import AppKey |
15 | | -from .log import access_logger |
| 15 | +from .log import access_logger, server_logger |
16 | 16 | from .typedefs import PathLike |
17 | 17 | from .web_app import Application, CleanupError |
18 | 18 | from .web_exceptions import ( |
@@ -277,35 +277,20 @@ async def _run_app( |
277 | 277 | port: int | None = None, |
278 | 278 | path: PathLike | TypingIterable[PathLike] | None = None, |
279 | 279 | sock: socket.socket | TypingIterable[socket.socket] | None = None, |
280 | | - shutdown_timeout: float = 60.0, |
281 | | - keepalive_timeout: float = 75.0, |
282 | 280 | ssl_context: SSLContext | None = None, |
283 | 281 | print: Callable[..., None] | None = print, |
284 | 282 | 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, |
289 | 283 | reuse_address: bool | None = None, |
290 | 284 | reuse_port: bool | None = None, |
291 | | - handler_cancellation: bool = False, |
| 285 | + **kwargs: Any, |
292 | 286 | ) -> None: |
293 | 287 | # An internal function to actually do all dirty job for application running |
294 | 288 | if asyncio.iscoroutine(app): |
295 | 289 | app = await app |
296 | 290 |
|
297 | 291 | app = cast(Application, app) |
298 | 292 |
|
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) |
309 | 294 |
|
310 | 295 | await runner.setup() |
311 | 296 |
|
@@ -453,6 +438,7 @@ def run_app( |
453 | 438 | reuse_port: bool | None = None, |
454 | 439 | handler_cancellation: bool = False, |
455 | 440 | loop: asyncio.AbstractEventLoop | None = None, |
| 441 | + **kwargs: Any, |
456 | 442 | ) -> None: |
457 | 443 | """Run an app locally""" |
458 | 444 | if loop is None: |
@@ -485,6 +471,7 @@ def run_app( |
485 | 471 | reuse_address=reuse_address, |
486 | 472 | reuse_port=reuse_port, |
487 | 473 | handler_cancellation=handler_cancellation, |
| 474 | + **kwargs, |
488 | 475 | ) |
489 | 476 | ) |
490 | 477 |
|
|
0 commit comments