Diff: adapt wait time according to replication interval

master
Yohan Boniface 2018-01-26 09:35:31 +01:00
parent e277d8da24
commit 6f99b41d13
1 changed files with 11 additions and 1 deletions

View File

@ -71,13 +71,23 @@ func newDownloader(dest, url string, seq int, interval time.Duration) *downloade
},
}
var naWaittime time.Duration
switch interval {
case 24 * time.Hour:
naWaittime = 5 * time.Minute
case time.Hour:
naWaittime = 60 * time.Second
default:
naWaittime = 10 * time.Second
}
dl := &downloader{
baseUrl: url,
dest: dest,
lastSequence: seq,
interval: interval,
errWaittime: 60 * time.Second,
naWaittime: 10 * time.Second,
naWaittime: naWaittime,
sequences: make(chan Sequence, 1),
client: client,
}