Fix env save-and-restart by deferring PM2 restart until after HTTP response.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-13 10:54:48 +08:00
parent c4753ffb89
commit 1bda78ceb2
5 changed files with 69 additions and 27 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ def register_instance_settings_routes(
@app.route("/api/admin/restart", methods=["POST"])
@api_auth
def api_admin_restart():
result = restart_instance_pm2(exchange_key)
result = restart_instance_pm2(exchange_key, defer=True)
code = 200 if result.get("ok") else 500
return jsonify({"ok": bool(result.get("ok")), **result}), code