[#933] write-cache: Use real number of objects in counters

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-10-19 19:22:47 +03:00 committed by Alex Vanin
parent 29955a3036
commit 616013cb8a

View file

@ -91,9 +91,12 @@ func (x *counters) Read() error {
x.cDB.Store(inDB) x.cDB.Store(inDB)
// FIXME: calculate the actual value in FSTree (new method?). inFS, err := x.fs.NumberOfObjects()
// For now we can think that db/fs = 50/50. if err != nil {
x.cFS.Store(inDB) return fmt.Errorf("could not read write-cache FS counter: %w", err)
}
x.cFS.Store(inFS)
return nil return nil
} }