Timeout refactor.

This commit is contained in:
Ben Johnson
2013-12-07 14:35:31 -07:00
parent aabd0faebe
commit 8442e7a0dc
7 changed files with 42 additions and 37 deletions

View File

@ -1,11 +1,13 @@
package server
const (
// The amount of time (ms) to elapse without a heartbeat before becoming a candidate.
ElectionTimeout = 200
// The frequency by which heartbeats are sent to followers.
HeartbeatTimeout = 50
RetryInterval = 10
import (
"time"
)
const (
// The amount of time to elapse without a heartbeat before becoming a candidate
defaultElectionTimeout = 200 * time.Millisecond
// The frequency by which heartbeats are sent to followers.
defaultHeartbeatTimeout = 50 * time.Millisecond
)