Skip to content

Commit e56ce08

Browse files
committed
[fix]Web 推理线程异常退出
1 parent daf4136 commit e56ce08

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/rk3576/realtime_detection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ async def index():
7878
""", media_type="text/html")
7979

8080
def run_fastapi(host, port):
81-
uvicorn.run(app, host=host, port=port, log_level="error")
81+
# 使用 log_config=None 避开某些环境下 uvicorn 日志配置报错的问题
82+
uvicorn.run(app, host=host, port=port, log_level="error", log_config=None)
8283

8384
# --- 原有推理逻辑 ---
8485

src/rk3576/web_detection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ async def index():
7878
""", media_type="text/html")
7979

8080
def run_fastapi(host, port):
81-
uvicorn.run(app, host=host, port=port, log_level="error")
81+
# 使用 log_config=None 避开某些环境下 uvicorn 日志配置报错的问题
82+
uvicorn.run(app, host=host, port=port, log_level="error", log_config=None)
8283

8384
# --- 推理逻辑 ---
8485

src/rk3588/realtime_detection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ async def index():
7878
""", media_type="text/html")
7979

8080
def run_fastapi(host, port):
81-
uvicorn.run(app, host=host, port=port, log_level="error")
81+
# 使用 log_config=None 避开某些环境下 uvicorn 日志配置报错的问题
82+
uvicorn.run(app, host=host, port=port, log_level="error", log_config=None)
8283

8384
# --- 原有推理逻辑 ---
8485

src/rk3588/web_detection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ async def index():
7878
""", media_type="text/html")
7979

8080
def run_fastapi(host, port):
81-
uvicorn.run(app, host=host, port=port, log_level="error")
81+
# 使用 log_config=None 避开某些环境下 uvicorn 日志配置报错的问题
82+
uvicorn.run(app, host=host, port=port, log_level="error", log_config=None)
8283

8384
# --- 推理逻辑 ---
8485

0 commit comments

Comments
 (0)