From 9536372cfbfd9439ff4870462626f21b302257ed Mon Sep 17 00:00:00 2001 From: Alpha <61853980+AlphaGHX@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:49:28 +0800 Subject: [PATCH] fix: call shutdown before restart (#709) --- hub/route/restart.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hub/route/restart.go b/hub/route/restart.go index 6c3f27f3..cae21844 100644 --- a/hub/route/restart.go +++ b/hub/route/restart.go @@ -8,7 +8,7 @@ import ( "runtime" "syscall" - "github.com/Dreamacro/clash/listener" + "github.com/Dreamacro/clash/hub/executor" "github.com/Dreamacro/clash/log" "github.com/go-chi/chi/v5" @@ -44,7 +44,7 @@ func restart(w http.ResponseWriter, r *http.Request) { func runRestart(execPath string) { var err error - listener.Cleanup(false) + executor.Shutdown() if runtime.GOOS == "windows" { cmd := exec.Command(execPath, os.Args[1:]...) log.Infoln("restarting: %q %q", execPath, os.Args[1:])