1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-02-16 03:02:59 +08:00
committed by cnb
parent deeb1ccc38
commit b67dd576e5
4 changed files with 9 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ import (
"fmt"
"io"
"log"
"os"
"sync/atomic"
"time"
@@ -98,10 +99,10 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) {
}
func (s *Server) OnTick() (delay time.Duration, action gnet.Action) {
g.Log().Async().Info(context.Background(), gtime.Now().ISO8601(), "服务器ID", cool.Config.ServerInfo.OnlineID, "链接数", atomic.LoadInt64(&cool.Connected))
// if s.quit && atomic.LoadInt64(&s.connected) == 0 {
// //执行正常退出逻辑
// os.Exit(0)
// }
if s.quit && atomic.LoadInt64(&cool.Connected) == 0 {
//执行正常退出逻辑
os.Exit(0)
}
return 30 * time.Second, gnet.None
}
func (s *Server) OnBoot(eng gnet.Engine) gnet.Action {