Merge pull request #1242 from roidelapluie/ptc

cluster: Make peer timeout configurable
This commit is contained in:
Fabian Reinartz 2018-02-14 11:20:53 +01:00 committed by GitHub
commit dd675e0c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -130,6 +130,8 @@ func main() {
clusterAdvertiseAddr = kingpin.Flag("cluster.advertise-address", "explicit address to advertise in cluster").String() clusterAdvertiseAddr = kingpin.Flag("cluster.advertise-address", "explicit address to advertise in cluster").String()
peerTimeout = kingpin.Flag("cluster.peer-timeout", "Time to wait between peers to send notifications.").Default("15s").Duration()
gossipInterval = kingpin.Flag("cluster.gossip-interval", "interval between sending gossip messages. By lowering this value (more frequent) gossip messages are propagated across the cluster more quickly at the expense of increased bandwidth."). gossipInterval = kingpin.Flag("cluster.gossip-interval", "interval between sending gossip messages. By lowering this value (more frequent) gossip messages are propagated across the cluster more quickly at the expense of increased bandwidth.").
Default(cluster.DefaultGossipInterval.String()).Duration() Default(cluster.DefaultGossipInterval.String()).Duration()
@ -261,7 +263,7 @@ func main() {
waitFunc := func() time.Duration { return 0 } waitFunc := func() time.Duration { return 0 }
if peer != nil { if peer != nil {
waitFunc = clusterWait(peer, 15*time.Second) waitFunc = clusterWait(peer, *peerTimeout)
} }
timeoutFunc := func(d time.Duration) time.Duration { timeoutFunc := func(d time.Duration) time.Duration {
if d < notify.MinTimeout { if d < notify.MinTimeout {