From d1c4744e04e3784a1e76baae8e292ae6812442bf Mon Sep 17 00:00:00 2001 From: jimleerx Date: Fri, 6 Feb 2026 19:55:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20fix:=E5=85=A5=E7=AB=99?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/handler/manage.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/internal/handler/manage.go b/internal/handler/manage.go index ab38f35..99ac9b1 100644 --- a/internal/handler/manage.go +++ b/internal/handler/manage.go @@ -1536,13 +1536,22 @@ func (h *ManageHandler) manageInbound(w http.ResponseWriter, r *http.Request) { return } - if err := h.removeInbound(ctx, clients.Handler, req.Tag); err != nil { - writeError(w, http.StatusInternalServerError, fmt.Sprintf("Failed to remove inbound: %v", err)) - return + // Try to remove from runtime (ignore error if not running) + runtimeErr := h.removeInbound(ctx, clients.Handler, req.Tag) + if runtimeErr != nil { + log.Printf("[Manage] Warning: Failed to remove inbound from runtime: %v", runtimeErr) } - if err := h.removeInboundFromConfig(req.Tag); err != nil { - log.Printf("[Manage] Warning: Failed to remove inbound from config: %v", err) + // Remove from config file (this is the primary operation) + configErr := h.removeInboundFromConfig(req.Tag) + if configErr != nil { + log.Printf("[Manage] Warning: Failed to remove inbound from config: %v", configErr) + } + + // Success if at least one operation succeeded + if runtimeErr != nil && configErr != nil { + writeError(w, http.StatusInternalServerError, fmt.Sprintf("Failed to remove inbound: runtime=%v, config=%v", runtimeErr, configErr)) + return } writeJSON(w, http.StatusOK, map[string]interface{}{