A useless Chtimes() call is still required for the tests :/

This commit is contained in:
Frank Denis 2023-08-11 11:16:44 +02:00
parent afcfd566c9
commit a108d048d8
1 changed files with 6 additions and 8 deletions

View File

@ -108,18 +108,16 @@ func (source *Source) updateCache(bin, sig []byte, now time.Time) {
absPath = resolved
}
if bytes.Equal(source.bin, bin) {
if err := os.Chtimes(file, now, now); err != nil {
dlog.Warnf("Couldn't update cache file [%s]: %s", absPath, err)
if !bytes.Equal(source.bin, bin) {
if err := writeSource(file, bin, sig); err != nil {
dlog.Warnf("Couldn't write cache file [%s]: %s", absPath, err) // an error writing to the cache isn't fatal
}
return
}
if err := os.Chtimes(file, now, now); err != nil {
dlog.Warnf("Couldn't update cache file [%s]: %s", absPath, err)
}
source.bin = bin
if err := writeSource(file, bin, sig); err != nil {
dlog.Warnf("Couldn't write cache file [%s]: %s", absPath, err) // an error writing to the cache isn't fatal
}
}
func (source *Source) parseURLs(urls []string) {