Skip to content

Commit

Permalink
opt: skip empty file
Browse files Browse the repository at this point in the history
  • Loading branch information
kulukami committed Aug 9, 2024
1 parent c0233f8 commit 0970783
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/scanner/src/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ impl Detector {
};
break;
*/
warn!("walkdir err, should continue: {:?}", _err);
continue
}
Some(Ok(entry)) => entry,
Expand All @@ -461,6 +462,15 @@ impl Detector {
if fp.is_dir() {
continue;
}
if let Ok(pmeta) = fp.metadata() {
let fsize = pmeta.len();
if fsize <= 4 || fsize > 1024 * 1024 * 100 {
continue;
}
}else{
continue
}

let task = ScanTaskUserTask::with_path(
t.get_token(),
&fp.to_string_lossy(),
Expand Down

0 comments on commit 0970783

Please sign in to comment.