perf(server): 调整服务器心跳间隔并优化服务器信息列表
- 将服务器心跳间隔从 3 秒调整为 10 秒 - 在 CommendSvrInfo 中使用 array 包对服务器信息列表进行排序 - 更新 go.mod 和 go.sum 文件,添加新的依赖项
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user