1 Star 0 Fork 75

懵懂的鸟 / yomo

forked from YoMo / yomo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
zipper_windows.go 637 Bytes
一键复制 编辑 原始数据 按行查看 历史
venjiang 提交于 2022-01-25 15:19 . fix: *nix compile (#281)
//go:build windows
// +build windows
package yomo
import (
"os"
"os/signal"
"syscall"
"github.com/yomorun/yomo/pkg/logger"
)
// initialize when zipper running as server. support inspection:
// - `kill -SIGTERM <pid>` graceful shutdown
func (z *zipper) init() {
go func() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGTERM, syscall.SIGINT)
logger.Printf("%sListening SIGTERM/SIGINT...", zipperLogPrefix)
for p1 := range c {
logger.Printf("Received signal: %s", p1)
if p1 == syscall.SIGTERM || p1 == syscall.SIGINT {
logger.Printf("graceful shutting down ... %s", p1)
os.Exit(0)
}
}
}()
}
Go
1
https://gitee.com/mengdongdeniao/yomo.git
git@gitee.com:mengdongdeniao/yomo.git
mengdongdeniao
yomo
yomo
master

搜索帮助