"fix: 为信号通道添加缓冲区防止阻塞"

This commit is contained in:
kingecg 2025-06-29 17:29:28 +08:00
parent bd1ddd8020
commit ec1d21254d
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ func (g *GoDaemon) Start() {
pid := os.Getpid()
os.WriteFile(g.pidFile, []byte(strconv.Itoa(pid)), 0644)
g.sigChan = make(chan os.Signal)
g.sigChan = make(chan os.Signal, 1)
signal.Notify(g.sigChan, syscall.SIGTERM, syscall.SIGHUP)
go g.serveSignal()