mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-24 10:38:34 +00:00
skip self
This commit is contained in:
@@ -450,6 +450,10 @@ func (b *Broker) connectRouter(id, addr string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Broker) checkNodeExist(id, url string) bool {
|
func (b *Broker) checkNodeExist(id, url string) bool {
|
||||||
|
if id == b.id {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
for k, v := range b.nodes {
|
for k, v := range b.nodes {
|
||||||
if k == id {
|
if k == id {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -522,10 +522,7 @@ func (c *client) Close() {
|
|||||||
|
|
||||||
//do reconnect
|
//do reconnect
|
||||||
if c.typ == REMOTE {
|
if c.typ == REMOTE {
|
||||||
localUrl := c.info.localIP + ":" + c.broker.config.Cluster.Port
|
go b.connectRouter(c.route.remoteID, c.route.remoteUrl)
|
||||||
if c.route.remoteUrl != localUrl {
|
|
||||||
go b.connectRouter(c.route.remoteID, c.route.remoteUrl)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user