This commit is contained in:
eric
2026-03-29 03:49:29 -05:00
parent 22061fb3c8
commit 7cab3f27b8
8 changed files with 99 additions and 17 deletions

8
web.py
View File

@@ -336,7 +336,11 @@ def script_for_pm2(pm2: str) -> Optional[str]:
@asynccontextmanager
async def lifespan(app: FastAPI):
await process_backend.refresh_mode()
try:
await process_backend.refresh_mode()
except Exception:
# PM2/Shell 异常时不阻塞整站启动(否则反代持续 502
pass
yield
@@ -364,7 +368,7 @@ async def alias_youtube_pro_channels_post(body: YoutubeProChannelsBody):
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["GET", "POST"],
allow_methods=["GET", "POST", "OPTIONS"],
allow_headers=["*"],
)