Keep LocalSize data in RAM

This commit is contained in:
Jakob Borg
2015-10-20 15:58:18 +02:00
parent 8c26fe44c3
commit d4f81e8791
3 changed files with 64 additions and 12 deletions

View File

@@ -406,16 +406,7 @@ func (m *Model) LocalSize(folder string) (nfiles, deleted int, bytes int64) {
m.fmut.RLock()
defer m.fmut.RUnlock()
if rf, ok := m.folderFiles[folder]; ok {
rf.WithHaveTruncated(protocol.LocalDeviceID, func(f db.FileIntf) bool {
if f.IsInvalid() {
return true
}
fs, de, by := sizeOfFile(f)
nfiles += fs
deleted += de
bytes += by
return true
})
nfiles, deleted, bytes = rf.Size()
}
return
}