removing a non-existent item from disk cache is not an error

This commit is contained in:
Kovid Goyal 2025-10-07 09:16:30 +05:30
parent 5d1ce327e0
commit 328745cad9
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -292,7 +292,10 @@ func (dc *DiskCache) add(key string, items map[string][]byte) (err error) {
}
if len(data) == 0 {
if err = os.Remove(p); err != nil {
return
if !os.IsNotExist(err) {
return
}
err = nil
}
changed -= before
} else {