perf(server): 调整服务器心跳间隔并优化服务器信息列表

- 将服务器心跳间隔从 3 秒调整为 10 秒
- 在 CommendSvrInfo 中使用 array 包对服务器信息列表进行排序
- 更新 go.mod 和 go.sum 文件,添加新的依赖项
This commit is contained in:
2025-07-07 21:16:15 +08:00
parent 33723334f9
commit 0760e7c77c
4 changed files with 17 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ func (s *Server) OnClose(c gnet.Conn, _ error) (action gnet.Action) {
}
func (s *Server) OnTick() (delay time.Duration, action gnet.Action) {
logging.Infof("[connected-count=%v]", atomic.LoadInt64(&s.connected))
return 3 * time.Second, gnet.None
return 10 * time.Second, gnet.None
}
func (s *Server) OnBoot(eng gnet.Engine) gnet.Action {
s.eng = eng