summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-02-04 11:31:11 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-02-04 11:31:11 +0900
commit7f6831ce1228e42b717f5bf3e507ddae06483ba1 (patch)
tree1e0d4f1ce6f09d7a52e20a9748023adde56cd9ec /server
parentf41f0b638276dc63949e437d9c0c5bbf8a3b37b0 (diff)
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 <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/fsm.go2
1 files changed, 1 insertions, 1 deletions
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)
}