修复 PM2 下 Flask debug=True 热重载导致 Bad file descriptor 崩溃循环。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user