Print redirects being followed, drop mirror.yandex.ru.

Use CDN-backed Debian mirror to make tests run faster hopefully for
everyone. Redirects might be important to know what exactly is going on
when items are being downloaded.
This commit is contained in:
Andrey Smirnov
2019-08-02 21:40:37 +03:00
committed by Andrey Smirnov
parent 021b6f694b
commit 26098f6c8d
52 changed files with 222 additions and 203 deletions

View File

@@ -53,6 +53,7 @@ func NewDownloader(downLimit int64, maxTries int, progress aptly.Progress) aptly
},
}
downloader.client.CheckRedirect = downloader.checkRedirect
if downLimit > 0 {
downloader.aggWriter = flowrate.NewWriter(progress, downLimit)
} else {
@@ -62,6 +63,14 @@ func NewDownloader(downLimit int64, maxTries int, progress aptly.Progress) aptly
return downloader
}
func (downloader *downloaderImpl) checkRedirect(req *http.Request, via []*http.Request) error {
if downloader.progress != nil {
downloader.progress.Printf("Following redirect to %s...\n", req.URL)
}
return nil
}
// GetProgress returns Progress object
func (downloader *downloaderImpl) GetProgress() aptly.Progress {
return downloader.progress