megacheck

This commit is contained in:
Frank Denis 2018-01-20 01:00:19 +01:00
parent 5dae74ab0b
commit b9e89d2278
1 changed files with 6 additions and 3 deletions

View File

@ -23,8 +23,7 @@ const (
)
const (
SourcesUpdateDelayAfterFailure = time.Duration(1) * time.Minute
SourcesUpdateDelay = time.Duration(24) * time.Hour
SourcesUpdateDelay = time.Duration(24) * time.Hour
)
type Source struct {
@ -118,9 +117,13 @@ func NewSource(url string, minisignKeyStr string, cacheFile string, formatStr st
urlsToPrefetch = append(urlsToPrefetch, URLToPrefetch{url: url, cacheFile: cacheFile, when: now.Add(delayTillNextUpdate)})
sigCacheFile := cacheFile + ".minisig"
sigStr, sigCached, sigDelayTillNextUpdate, err := fetchWithCache(sigURL, sigCacheFile)
sigStr, sigCached, sigDelayTillNextUpdate, sigErr := fetchWithCache(sigURL, sigCacheFile)
urlsToPrefetch = append(urlsToPrefetch, URLToPrefetch{url: sigURL, cacheFile: sigCacheFile, when: now.Add(sigDelayTillNextUpdate)})
if err != nil || sigErr != nil {
return source, urlsToPrefetch, nil
}
signature, err := minisign.DecodeSignature(sigStr)
if err != nil {
os.Remove(cacheFile)