From 198321c4a924da1ec48b3c01c0cd92bdea90e2f9 Mon Sep 17 00:00:00 2001 From: claude_dev Date: Tue, 7 Jul 2026 05:59:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(deploy):=20run=5Fweb.py=20=E5=88=87=20sang?= =?UTF-8?q?uo=5Fapi.main:create=5Fapp=20--factory=EF=BC=88=E5=8D=95?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run_web.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/run_web.py b/run_web.py index 5e892f8..dd585a7 100644 --- a/run_web.py +++ b/run_web.py @@ -18,11 +18,14 @@ if os.path.exists(vnpy_dir): if __name__ == "__main__": import uvicorn - # 启动服务器 + # Phase 3b 起:研究/回测 API sanguo_api(工厂模式,读 config/backtest.yaml) + # 单进程(uvicorn.run 默认 workers=1)——orchestrator 任务状态在内存,必须单进程。 + # 端口 8000 不变(vnpy.mysanguo.top 外网绑定依赖)。 uvicorn.run( - "sanguo_web.api:app", + "sanguo_api.main:create_app", + factory=True, host="0.0.0.0", - port=8000, # 默认端口 8000 + port=8000, reload=False, # 生产模式 log_level="info" )