change cache status display
This commit is contained in:
parent
9cc2b04342
commit
f3e2a9240d
1 changed files with 5 additions and 1 deletions
|
|
@ -279,7 +279,11 @@ func (fs *FS) CacheStatus(name string) int {
|
|||
fs.mu.RLock()
|
||||
defer fs.mu.RUnlock()
|
||||
if md, ok := fs.md[name]; ok {
|
||||
return int(math.Round(float64(md.Chunks.Size()) / float64(md.Size) * 100))
|
||||
size := md.Chunks.Size()
|
||||
if size == 0 {
|
||||
return -1
|
||||
}
|
||||
return int(math.Round(float64(size) / float64(md.Size) * 100))
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue