连接优化

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
}
log.Debug("ClusterJoin ServerId %v", clusterJoin.ServerId)
connectRemote(clusterJoin.RemoteAddr, clusterJoin.ServerId, "server")
//connectRemote(clusterJoin.RemoteAddr, clusterJoin.ServerId, "server")
return nil
}
@ -104,6 +104,7 @@ func connectRemote(RemoteAddr string, ConnType int, ConnLabel string) error {
client.Start()
Center = client
clients = append(clients, client)
log.Debug("connet remote to addr:%s", RemoteAddr)
return nil
}

View File

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