diff --git a/app.py b/app.py index 8766628..a3caa39 100644 --- a/app.py +++ b/app.py @@ -765,4 +765,12 @@ def api_cond_orders_exit(hub_order_id: str): 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, + )