45 Star 300 Fork 75

GVPYoMo / yomo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
zipper_windows.go 670 Bytes
一键复制 编辑 原始数据 按行查看 历史
wurui 提交于 2023-04-21 17:25 . chore: fix zipper windows build (#510)
//go:build windows
// +build windows
package yomo
import (
"os"
"os/signal"
"syscall"
"github.com/yomorun/yomo/core"
"github.com/yomorun/yomo/core/ylog"
)
// initialize when zipper running as server. support inspection:
// - `kill -SIGTERM <pid>` graceful shutdown
func waitSignalForShutdownServer(server *core.Server) {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGTERM, syscall.SIGINT)
ylog.Info("Listening SIGTERM/SIGINT...")
for p1 := range c {
ylog.Debug("Received signal", "signal", p1)
if p1 == syscall.SIGTERM || p1 == syscall.SIGINT {
server.Close()
ylog.Debug("graceful shutting down ...", "sign", p1)
os.Exit(0)
}
}
}
Go
1
https://gitee.com/yomorun/yomo.git
git@gitee.com:yomorun/yomo.git
yomorun
yomo
yomo
master

搜索帮助