修复 PM2 下 Flask debug=True 热重载导致 Bad file descriptor 崩溃循环。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-04 07:50:08 +08:00
parent 5b4e35c582
commit 04c750f2dd
+9 -1
View File
@@ -765,4 +765,12 @@ def api_cond_orders_exit(hub_order_id: str):
if __name__ == "__main__": if __name__ == "__main__":
app.run(host=APP_HOST, port=APP_PORT, debug=True, threaded=True) # PM2 下禁止 debug reloader,否则会 Bad file descriptor 崩循环
_debug = (os.getenv("APP_DEBUG") or "").strip().lower() in ("1", "true", "yes", "on")
app.run(
host=APP_HOST,
port=APP_PORT,
debug=_debug,
use_reloader=False,
threaded=True,
)