ignore 0 byte files when picking up changes

This commit is contained in:
Damien Elmes 2020-02-08 20:56:14 +10:00
parent 4fa4a5077c
commit 933b7a9a34

View File

@ -115,11 +115,14 @@ where
continue; continue;
} }
// ignore large files // ignore large files and zero byte files
let metadata = dentry.metadata()?; let metadata = dentry.metadata()?;
if metadata.len() > MEDIA_SYNC_FILESIZE_LIMIT as u64 { if metadata.len() > MEDIA_SYNC_FILESIZE_LIMIT as u64 {
continue; continue;
} }
if metadata.len() == 0 {
continue;
}
// remove from mtimes for later deletion tracking // remove from mtimes for later deletion tracking
let previous_mtime = mtimes.remove(fname.as_ref()); let previous_mtime = mtimes.remove(fname.as_ref());