diff --git a/Cargo.lock b/Cargo.lock index 8286fe5..61ab15e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -655,7 +655,7 @@ dependencies = [ [[package]] name = "ngxav" -version = "0.5.0" +version = "0.5.1" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index c26d29b..a850f45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ workspace = { members = [ "tests","tests/obfuscate_access_log_ips"] } [package] name = "ngxav" -version = "0.5.0" +version = "0.5.1" edition = "2021" license = "MIT" description = "Search through NGINX logs with advanced filters and support for displaying analytics about your selected log entries" diff --git a/src/utils/read_folder_conserve_memory.rs b/src/utils/read_folder_conserve_memory.rs index 962c33e..69e64d3 100644 --- a/src/utils/read_folder_conserve_memory.rs +++ b/src/utils/read_folder_conserve_memory.rs @@ -18,10 +18,7 @@ pub fn read_folder_conserve_memory(file_path: String, isUnique: Option) { let mut occurrences: HashMap = HashMap::new(); for path in paths { let p: String = path.unwrap().path().to_str().unwrap().to_string(); - if p.contains("error") { - break; - } - if p.contains(".gz") { + if !p.contains("error") && p.contains(".gz") { let file = File::open(p).expect("Ooops."); let reader = BufReader::new(GzDecoder::new(file)); for r in reader.lines() { @@ -49,7 +46,7 @@ pub fn read_folder_conserve_memory(file_path: String, isUnique: Option) { } } } - } else { + } else if !p.contains("error") { let file = File::open(p).expect("Ooops."); let reader = BufReader::new(file).lines(); for line in reader.flatten() {