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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user