Allow fractional percentages (fixes #2233)
This commit is contained in:
@@ -508,14 +508,13 @@ func (p *rwFolder) pullerIteration(ignores *ignore.Matcher) int {
|
||||
return true
|
||||
})
|
||||
|
||||
// Check if we are able to store all files on disk
|
||||
if pullFileSize > 0 {
|
||||
folder, ok := p.model.cfg.Folders()[p.folder]
|
||||
if ok {
|
||||
if free, err := osutil.DiskFreeBytes(folder.Path()); err == nil && free < pullFileSize {
|
||||
l.Infof("Puller (folder %q): insufficient disk space available to pull %d files (%.2fMB)", p.folder, changed, float64(pullFileSize)/1024/1024)
|
||||
return 0
|
||||
}
|
||||
// Check if we are able to store all files on disk. Only perform this
|
||||
// check if there is a minimum free space threshold set on the folder.
|
||||
folderCfg := p.model.cfg.Folders()[p.folder]
|
||||
if folderCfg.MinDiskFreePct > 0 || pullFileSize > 0 {
|
||||
if free, err := osutil.DiskFreeBytes(folderCfg.Path()); err == nil && free < pullFileSize {
|
||||
l.Warnf(`Folder "%s": insufficient disk space available to pull %d files (%.2f MiB)`, p.folder, changed, float64(pullFileSize)/1024/1024)
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user