Procházet zdrojové kódy

Add ThresholdMonitorTimeout.

Ben Johnson před 12 roky
rodič
revize
b47042634a
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      server/peer_server.go

+ 3 - 1
server/peer_server.go

@@ -22,6 +22,8 @@ import (
 
 const retryInterval = 10
 
+const ThresholdMonitorTimeout = 5 * time.Second
+
 type PeerServer struct {
 	raftServer       raft.Server
 	server           *Server
@@ -512,6 +514,6 @@ func (s *PeerServer) monitorTimeoutThreshold(closeChan chan bool) {
 			return
 		}
 
-		time.Sleep(5 * time.Second)
+		time.Sleep(ThresholdMonitorTimeout)
 	}
 }