新增自动迁移创建路由后重启

新增自动迁移创建路由后重启
This commit is contained in:
奇淼(piexlmax
2021-05-12 17:39:15 +08:00
committed by GitHub
5 changed files with 40 additions and 24 deletions
+18
View File
@@ -0,0 +1,18 @@
package utils
import (
"errors"
"os"
"os/exec"
"runtime"
"strconv"
)
func Reload() error {
if runtime.GOOS == "windows" {
return errors.New("系统不支持")
}
pid := os.Getpid()
cmd := exec.Command("kill", "-1", strconv.Itoa(pid))
return cmd.Run()
}