Skip to content

Commit

Permalink
fix: fix hot swapping disk panic
Browse files Browse the repository at this point in the history
fix #7
  • Loading branch information
cokemine committed Nov 1, 2021
1 parent 38a04c2 commit 2ec85d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/status/status.go
Expand Up @@ -61,7 +61,11 @@ func Disk(INTERVAL *float64) (uint64, uint64) {
}
timer -= *INTERVAL
for k := range cachedFs {
usage, _ := disk.Usage(k)
usage, err := disk.Usage(k)
if err != nil {
delete(cachedFs, k)
continue
}
size += usage.Total / 1024.0 / 1024.0
used += usage.Used / 1024.0 / 1024.0
}
Expand Down

0 comments on commit 2ec85d7

Please sign in to comment.