mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
@@ -179,6 +179,9 @@ func (downloader *downloaderImpl) DownloadWithChecksum(ctx context.Context, url
|
|||||||
|
|
||||||
var temppath string
|
var temppath string
|
||||||
maxTries := downloader.maxTries
|
maxTries := downloader.maxTries
|
||||||
|
const delayBase = 1
|
||||||
|
const delayMultiplier = 2
|
||||||
|
delay := time.Duration(delayBase * time.Second)
|
||||||
for maxTries > 0 {
|
for maxTries > 0 {
|
||||||
temppath, err = downloader.download(req, url, destination, expected, ignoreMismatch)
|
temppath, err = downloader.download(req, url, destination, expected, ignoreMismatch)
|
||||||
|
|
||||||
@@ -188,6 +191,9 @@ func (downloader *downloaderImpl) DownloadWithChecksum(ctx context.Context, url
|
|||||||
downloader.progress.Printf("Error downloading %s: %s retrying...\n", url, err)
|
downloader.progress.Printf("Error downloading %s: %s retrying...\n", url, err)
|
||||||
}
|
}
|
||||||
maxTries--
|
maxTries--
|
||||||
|
time.Sleep(delay)
|
||||||
|
// Sleep exponentially at the next retry
|
||||||
|
delay *= delayMultiplier
|
||||||
} else {
|
} else {
|
||||||
if downloader.progress != nil {
|
if downloader.progress != nil {
|
||||||
downloader.progress.Printf("Error downloading %s: %s cannot retry...\n", url, err)
|
downloader.progress.Printf("Error downloading %s: %s cannot retry...\n", url, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user