Use new fscache's SetKeyMapper

See https://github.com/djherbis/fscache/commit/a0daa9e52747abb014105525761b2668b19b0818
This commit is contained in:
Deluan
2020-11-03 12:52:44 -05:00
parent f4a88b8319
commit 2f56f1b178
4 changed files with 24 additions and 37 deletions
+10 -1
View File
@@ -201,5 +201,14 @@ func newFSCache(name, cacheSize, cacheFolder string, maxItems int) (fscache.Cach
return nil, err
}
return fscache.NewCacheWithHaunter(fs, h)
ck, err := fscache.NewCacheWithHaunter(fs, h)
if err != nil {
return nil, err
}
if conf.Server.DevNewCacheLayout {
ck.SetKeyMapper(fs.(*spreadFS).KeyMapper)
}
return ck, nil
}