etcd: fix cluster sync

release-2.0
Xiang Li 2014-07-17 09:06:32 -07:00 committed by Yicheng Qin
parent 9746de91bf
commit 9756dba57a
1 changed files with 2 additions and 1 deletions

View File

@ -394,7 +394,7 @@ func (s *Server) runParticipant() {
}
func (s *Server) runStandby() {
syncDuration := time.Duration(0)
var syncDuration time.Duration
for {
select {
case <-time.After(syncDuration):
@ -407,6 +407,7 @@ func (s *Server) runStandby() {
log.Println("standby sync:", err)
continue
}
syncDuration = time.Duration(s.clusterConf.SyncInterval * float64(time.Second))
if s.clusterConf.ActiveSize <= len(s.nodes) {
continue
}