mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
cmd/syncthing: Improve messages when free space is running out (#5415)
This commit is contained in:
parent
2ad40734f8
commit
9d075781ad
@ -85,10 +85,10 @@ func checkFreeSpace(req Size, usage fs.Usage) error {
|
|||||||
if req.Percentage() {
|
if req.Percentage() {
|
||||||
freePct := (float64(usage.Free) / float64(usage.Total)) * 100
|
freePct := (float64(usage.Free) / float64(usage.Total)) * 100
|
||||||
if freePct < val {
|
if freePct < val {
|
||||||
return fmt.Errorf("%f %% < %v", freePct, req)
|
return fmt.Errorf("not enough free space, %f %% < %v", freePct, req)
|
||||||
}
|
}
|
||||||
} else if float64(usage.Free) < val {
|
} else if float64(usage.Free) < val {
|
||||||
return fmt.Errorf("%v < %v", usage.Free, req)
|
return fmt.Errorf("not enough free space, %v < %v", usage.Free, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user