连接优化

This commit is contained in:
hahwu 2025-12-30 16:35:59 +08:00
parent 5c0ea843a0
commit 2b5f0e099f
2 changed files with 3 additions and 2 deletions

View File

@ -74,7 +74,7 @@ func ClusterJoin(a *Agent, m *msg.Msg) error {
return nil return nil
} }
log.Debug("ClusterJoin ServerId %v", clusterJoin.ServerId) log.Debug("ClusterJoin ServerId %v", clusterJoin.ServerId)
connectRemote(clusterJoin.RemoteAddr, clusterJoin.ServerId, "server") //connectRemote(clusterJoin.RemoteAddr, clusterJoin.ServerId, "server")
return nil return nil
} }
@ -104,6 +104,7 @@ func connectRemote(RemoteAddr string, ConnType int, ConnLabel string) error {
client.Start() client.Start()
Center = client Center = client
clients = append(clients, client) clients = append(clients, client)
log.Debug("connet remote to addr:%s", RemoteAddr)
return nil return nil
} }

View File

@ -379,7 +379,7 @@ func NewWorkerPool(workers, maxQueue int) *WorkerPool {
} }
pool.start() pool.start()
// 启动监控协程,负责动态扩缩容 // 启动监控协程,负责动态扩缩容
pool.monitorTick = time.NewTicker(500 * time.Millisecond) pool.monitorTick = time.NewTicker(3000 * time.Millisecond)
go pool.monitor() go pool.monitor()
return pool return pool
} }