From ad127f1ebdc7d7094f7593d4fe18a5a8eee9409f Mon Sep 17 00:00:00 2001 From: zanllp Date: Sun, 30 Jul 2023 04:07:45 +0800 Subject: [PATCH] fix --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 5a4c123..c6a6c7e 100644 --- a/app.py +++ b/app.py @@ -92,13 +92,13 @@ class AppUtils: self.__init__(*args, **kwargs) @staticmethod - def async_run(app: FastAPI, port: int = default_port) -> Coroutine: + def async_run(app: FastAPI, port: int = default_port, host = default_host) -> Coroutine: """ 用于从异步运行的 FastAPI,在 Jupyter Notebook 环境中非常有用 """ # 不建议改成 async def,并且用 await 替换 return, # 因为这样会失去对 server.serve() 的控制。 - config = uvicorn.Config(app, host=default_host, port=port) + config = uvicorn.Config(app, host=host, port=port) server = uvicorn.Server(config) return server.serve()