From 09707838fb168d16946c137330aa74e9c3528137 Mon Sep 17 00:00:00 2001 From: kulukami Date: Fri, 9 Aug 2024 16:57:20 +0800 Subject: [PATCH] opt: skip empty file --- plugins/scanner/src/detector.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/scanner/src/detector.rs b/plugins/scanner/src/detector.rs index 272da098e..34eec712c 100644 --- a/plugins/scanner/src/detector.rs +++ b/plugins/scanner/src/detector.rs @@ -453,6 +453,7 @@ impl Detector { }; break; */ + warn!("walkdir err, should continue: {:?}", _err); continue } Some(Ok(entry)) => entry, @@ -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(),