连接优化
This commit is contained in:
parent
5c0ea843a0
commit
2b5f0e099f
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user