fix: startup crash if access long was turned off
This commit is contained in:
parent
fa8ba1af34
commit
ab56a7d8c9
1 changed files with 12 additions and 10 deletions
22
app/main.py
22
app/main.py
|
|
@ -199,16 +199,18 @@ class Main:
|
||||||
)
|
)
|
||||||
HTTP_LOGGER_CLASS = HttpAccessLogger
|
HTTP_LOGGER_CLASS = HttpAccessLogger
|
||||||
|
|
||||||
web.run_app(
|
run_args = {
|
||||||
self._app,
|
"host": host,
|
||||||
host=host,
|
"port": port,
|
||||||
port=port,
|
"loop": asyncio.get_event_loop(),
|
||||||
loop=asyncio.get_event_loop(),
|
"access_log": HTTP_LOGGER,
|
||||||
access_log=HTTP_LOGGER,
|
"print": started,
|
||||||
access_log_class=HTTP_LOGGER_CLASS,
|
"handle_signals": cb is None,
|
||||||
print=started,
|
}
|
||||||
handle_signals=cb is None,
|
if HTTP_LOGGER_CLASS is not None:
|
||||||
)
|
run_args["access_log_class"] = HTTP_LOGGER_CLASS
|
||||||
|
|
||||||
|
web.run_app(self._app, **run_args)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue