Skip to content
Permalink
Browse files

fix bug: invalid peer name

  • Loading branch information...
孙飞 孙飞
孙飞 authored and 孙飞 committed Apr 17, 2019
1 parent 17cbe78 commit 12327050beda7a6d95045911e11109a9644108af
Showing with 7 additions and 0 deletions.
  1. +7 −0 internal/pkg/cluster/cluster.go
@@ -122,6 +122,7 @@ func (c *Cluster) OnGossip(buf []byte) (delta mesh.GossipData, err error) {
c.subs.Merge(other)
c.Unlock()

fmt.Println("after gossip merge")
for topic, subs := range c.subs {
for cid, sub := range subs {
fmt.Printf("topic: %v, 用户: %v ,所在节点: %v\n", topic, cid, sub.Peer)
@@ -143,6 +144,12 @@ func (c *Cluster) OnGossipBroadcast(src mesh.PeerName, buf []byte) (received mes
switch event.Type {
case TypeSubscribe:
c.subscribe(event.Tid, event.Cid, src)
fmt.Println("after subscribe")
for topic, subs := range c.subs {
for cid, sub := range subs {
fmt.Printf("topic: %v, 用户: %v ,所在节点: %v\n", topic, cid, sub.Peer)
}
}
case TypeUnsubscribe:
c.unsubscribe(event.Tid, event.Cid)
}

0 comments on commit 1232705

Please sign in to comment.
You can’t perform that action at this time.