's'
This commit is contained in:
8
web.py
8
web.py
@@ -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=["*"],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user