fix bug and refine ,end of 2025

This commit is contained in:
xinzish
2025-12-31 16:11:28 +08:00
parent 38fb35a333
commit 32bbe3ddcd
23 changed files with 3180 additions and 68 deletions

18
run_server.py Normal file
View File

@@ -0,0 +1,18 @@
import asyncio
import sys
import uvicorn
if __name__ == "__main__":
# Windows 设置事件循环策略
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
# 用 uvicorn.run 支持 workers 参数
uvicorn.run(
"main:app",
host="0.0.0.0",
port=8000,
workers=2, # 这里可以设置多进程
loop="asyncio",
)