fix: call shutdown before restart (#709)
This commit is contained in:
parent
630a17cf90
commit
9536372cfb
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/listener"
|
"github.com/Dreamacro/clash/hub/executor"
|
||||||
"github.com/Dreamacro/clash/log"
|
"github.com/Dreamacro/clash/log"
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
|
@ -44,7 +44,7 @@ func restart(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
func runRestart(execPath string) {
|
func runRestart(execPath string) {
|
||||||
var err error
|
var err error
|
||||||
listener.Cleanup(false)
|
executor.Shutdown()
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
cmd := exec.Command(execPath, os.Args[1:]...)
|
cmd := exec.Command(execPath, os.Args[1:]...)
|
||||||
log.Infoln("restarting: %q %q", execPath, os.Args[1:])
|
log.Infoln("restarting: %q %q", execPath, os.Args[1:])
|
||||||
|
|
Loading…
Reference in a new issue