From 7f6831ce1228e42b717f5bf3e507ddae06483ba1 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Thu, 4 Feb 2016 11:31:11 +0900 Subject: server: make initial active connect faster give random.Intn() MIN_CONNECT_RETRY(10s) instead of connect-retry (120s by default). Signed-off-by: ISHIDA Wataru --- server/fsm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/fsm.go') diff --git a/server/fsm.go b/server/fsm.go index 6e565a29..6656d544 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -336,7 +336,7 @@ func (fsm *FSM) connectLoop() error { case <-ticker.C: connect() case <-fsm.getActiveCh: - time.Sleep(time.Duration(r.Intn(tick)+MIN_CONNECT_RETRY) * time.Second) + time.Sleep(time.Duration(r.Intn(MIN_CONNECT_RETRY)+MIN_CONNECT_RETRY) * time.Second) connect() ticker = time.NewTicker(time.Duration(tick) * time.Second) } -- cgit v1.2.3