Skip to content

Commit

Permalink
update cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
孙飞 authored and 孙飞 committed Apr 3, 2019
1 parent 2038874 commit 1a63a18
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cluster/cluster.go
Expand Up @@ -8,6 +8,7 @@ import (
"sort"
"strings"
"sync"
"time"

"github.com/imdevlab/flap/pkg/config"
"github.com/imdevlab/flap/pkg/message"
Expand Down Expand Up @@ -86,7 +87,11 @@ func New() *Cluster {
router.ConnectionMaker.InitiateConnections(peers.slice(), true)

// When a node comes online, it will broadcast the online message to all peers
c.gossip.GossipBroadcast(OnlineMessage{})
go func() {
time.Sleep(2 * time.Second)
c.gossip.GossipBroadcast(OnlineMessage{})
}()

return c
}

Expand Down

0 comments on commit 1a63a18

Please sign in to comment.