mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
A useless Chtimes() call is still required for the tests :/
This commit is contained in:
parent
afcfd566c9
commit
a108d048d8
1 changed files with 6 additions and 8 deletions
|
@ -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)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
source.bin = bin
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
if err := os.Chtimes(file, now, now); err != nil {
|
||||
dlog.Warnf("Couldn't update cache file [%s]: %s", absPath, err)
|
||||
}
|
||||
|
||||
source.bin = bin
|
||||
}
|
||||
|
||||
func (source *Source) parseURLs(urls []string) {
|
||||
|
|
Loading…
Add table
Reference in a new issue