From dbeaea03adc0759c0532ac4ee4af0702f7469641 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Sun, 14 Jun 2026 17:19:07 +0200 Subject: [PATCH] ignore metadata change on config file This avoids parsing the config file a second time on change because of the metadata change. --- src/config.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index ecce2b4..cc6baf9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,7 @@ use crate::capture_test::TestCaptureArgs; use crate::emulation_test::TestEmulationArgs; use clap::{Parser, Subcommand, ValueEnum}; +use notify::event::ModifyKind; use notify::{EventKind, RecommendedWatcher, Watcher}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -406,7 +407,9 @@ impl Config { if event.paths.contains(&self.config_path) && matches!( event.kind, - EventKind::Create(_) | EventKind::Modify(_) | EventKind::Remove(_) + EventKind::Create(_) + | EventKind::Modify(ModifyKind::Data(_)) + | EventKind::Remove(_) ) && self.read_from_disk()? { @@ -524,6 +527,11 @@ impl Config { } Err(e) => log::warn!("{:?} {e}", self.config_path()), }; + if changed { + log::info!("config changed"); + } else { + log::info!("config unchanged"); + } Ok(changed) }