summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
b300a04)
Syncthing may take more time to start for example on slow network connection.
// Establish connection with local Syncthing (retry if connection fail)
time.Sleep(3 * time.Second)
// Establish connection with local Syncthing (retry if connection fail)
time.Sleep(3 * time.Second)
+ maxRetry := 30
+ retry := maxRetry
for retry > 0 {
if err := ctx.SThg.Connect(); err == nil {
break
}
for retry > 0 {
if err := ctx.SThg.Connect(); err == nil {
break
}
- ctx.Log.Infof("Establishing connection to Syncthing (retry %d/10)", retry)
+ ctx.Log.Infof("Establishing connection to Syncthing (retry %d/%d", retry, maxRetry)
time.Sleep(time.Second)
retry--
}
time.Sleep(time.Second)
retry--
}