mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-03 16:13:30 +08:00
chore: cleanup listener before restart
This commit is contained in:
parent
bc508fba84
commit
fee9cb7bc8
@ -8,6 +8,7 @@ import (
|
||||
"runtime"
|
||||
"syscall"
|
||||
|
||||
"github.com/Dreamacro/clash/listener"
|
||||
"github.com/Dreamacro/clash/log"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
@ -43,7 +44,7 @@ func restart(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func runRestart(execPath string) {
|
||||
var err error
|
||||
|
||||
listener.Cleanup(false)
|
||||
if runtime.GOOS == "windows" {
|
||||
cmd := exec.Command(execPath, os.Args[1:]...)
|
||||
log.Infoln("restarting: %q %q", execPath, os.Args[1:])
|
||||
|
Loading…
x
Reference in New Issue
Block a user