diff options
author | Jakob Borg <jakob@nym.se> | 2014-06-15 20:32:26 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-06-15 20:32:26 +0200 |
commit | 21b699826dbaef5f64189d722ab8cba7b698028a (patch) | |
tree | 469c4b5a137d6478f19a06b9125cebefc8878dd8 /cmd | |
parent | 5fa8f8e50ca09977753686485ce4863df58a7e61 (diff) |
Increase reconnect delay towards maxv0.8.15
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/syncthing/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 7f6f5a2aad..475501279e 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -612,6 +612,7 @@ func listenConnect(myID string, m *model.Model, tlsCfg *tls.Config) { // Connect go func() { + var delay time.Duration = 1 * time.Second for { nextNode: for _, nodeCfg := range cfg.Nodes { @@ -662,7 +663,11 @@ func listenConnect(myID string, m *model.Model, tlsCfg *tls.Config) { } } - time.Sleep(time.Duration(cfg.Options.ReconnectIntervalS) * time.Second) + time.Sleep(delay) + delay *= 2 + if maxD := time.Duration(cfg.Options.ReconnectIntervalS) * time.Second; delay > maxD { + delay = maxD + } } }() |