This commit is contained in:
刘河
2019-03-31 19:23:25 +08:00
parent 5bbf247863
commit 92ea594ccf

23
server/tool/reload.go Normal file
View File

@@ -0,0 +1,23 @@
// +build !windows
package tool
import (
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
"os"
"os/signal"
"path/filepath"
"syscall"
)
func init() {
s := make(chan os.Signal, 1)
signal.Notify(s, syscall.SIGUSR1)
go func() {
for {
<-s
beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf"))
}
}()
}