From 0464021e50bdece8adad56eff0241fd1d81696a1 Mon Sep 17 00:00:00 2001 From: qpxdesign Date: Fri, 8 Mar 2024 11:55:01 -0500 Subject: [PATCH] fixed file sorting in cm read_folder, updated readme --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/utils/read_folder_conserve_memory.rs | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 810aef1..4180261 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -655,7 +655,7 @@ dependencies = [ [[package]] name = "ngxav" -version = "0.5.3" +version = "0.5.4" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index d825978..ed509a8 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.3" +version = "0.5.4" 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 8490a20..9246036 100644 --- a/src/utils/read_folder_conserve_memory.rs +++ b/src/utils/read_folder_conserve_memory.rs @@ -6,6 +6,7 @@ use std::fs; use std::fs::metadata; use std::fs::File; use std::io::{BufRead, BufReader}; +use std::time::SystemTime; pub fn read_folder_conserve_memory(file_path: String, isUnique: Option) { let mut paths: Vec<_> = fs::read_dir(file_path).unwrap().collect(); @@ -14,6 +15,9 @@ pub fn read_folder_conserve_memory(file_path: String, isUnique: Option) { .unwrap() .created() .unwrap() + .duration_since(SystemTime::UNIX_EPOCH) + .unwrap() + .as_secs() }); paths.reverse(); let mut occurrences: HashMap = HashMap::new();