cache file open bugfix

This commit is contained in:
ston1th 2022-06-03 23:37:29 +02:00
commit b69c78b380
2 changed files with 5 additions and 4 deletions

View file

@ -199,14 +199,15 @@ func (fs *FS) Open(name string) (f http.File, err error) {
f = &Dir{log: log.WithName("dir"), f: file, dc: fs.dc}
return
}
md := fs.mh.Metadata(name, fi.Size())
size := fi.Size()
md := fs.mh.Metadata(name, size)
var cache provider.File
if offline {
log.V(2).Info("file offline mode")
cache = file
} else {
cache, err = fs.dst.Open(name)
cache, err = fs.openCacheFile(name, size)
if err != nil {
if !skipLog(name) {
log.Error(err, "error opening cache file")