From 9756dba57ae3090d6f14791002df855bf812d52f Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Thu, 17 Jul 2014 09:06:32 -0700 Subject: [PATCH] etcd: fix cluster sync --- etcd/etcd.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etcd/etcd.go b/etcd/etcd.go index 6e1c84cb5..6bdda31c4 100644 --- a/etcd/etcd.go +++ b/etcd/etcd.go @@ -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 }