mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-13 00:36:28 +00:00
Additional output on insufficient error (ref #2580)
This commit is contained in:
parent
4ab4aeacb0
commit
cc0b9e5088
@ -1759,8 +1759,11 @@ func (m *Model) CheckFolderHealth(id string) error {
|
|||||||
// Check for free space, if it isn't a master folder. We aren't
|
// Check for free space, if it isn't a master folder. We aren't
|
||||||
// going to change the contents of master folders, so we don't
|
// going to change the contents of master folders, so we don't
|
||||||
// care about the amount of free space there.
|
// care about the amount of free space there.
|
||||||
if free, errDfp := osutil.DiskFreePercentage(folder.Path()); errDfp == nil && free < folder.MinDiskFreePct {
|
diskFreeP, errDfp := osutil.DiskFreePercentage(folder.Path())
|
||||||
err = errors.New("insufficient free space")
|
if errDfp == nil && diskFreeP < folder.MinDiskFreePct {
|
||||||
|
diskFreeBytes, _ := osutil.DiskFreeBytes(folder.Path())
|
||||||
|
str := fmt.Sprintf("insufficient free space (%d MiB, %.2f%%)", diskFreeBytes/1024/1024, diskFreeP)
|
||||||
|
err = errors.New(str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user