mirror of
https://github.com/YGGverse/htcount.git
synced 2026-03-31 17:15:37 +00:00
parse time once per queue
This commit is contained in:
parent
120f8811c2
commit
640c9a9d6d
1 changed files with 7 additions and 2 deletions
|
|
@ -32,13 +32,18 @@ fn main() -> anyhow::Result<()> {
|
|||
debug::info("Index queue begin...");
|
||||
}
|
||||
|
||||
let now = argument
|
||||
.match_time
|
||||
.as_ref()
|
||||
.map(|t| chrono::Local::now().format(t).to_string());
|
||||
|
||||
let mut index: HashMap<String, usize> = HashMap::with_capacity(argument.capacity);
|
||||
|
||||
'l: for line in BufReader::new(File::open(&argument.source)?).lines() {
|
||||
let l = line?;
|
||||
|
||||
if let Some(ref t) = argument.match_time {
|
||||
if !l.contains(&chrono::Local::now().format(t).to_string()) {
|
||||
if let Some(ref t) = now {
|
||||
if !l.contains(t) {
|
||||
if is_debug_d {
|
||||
debug::info(&format!("Record time mismatch time filter {t}"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue