Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: call shutdown() before restart #709

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hub/route/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:])
Expand Down