From b005bbca6d8c1adb9c12e10d79028717b9d963c5 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 19 Aug 2024 02:51:59 +0200 Subject: skip reloading empty config --- src/config.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 6ef392d..6a22657 100644 --- a/src/config.rs +++ b/src/config.rs @@ -211,6 +211,9 @@ pub fn setup_file_watch(config_path: PathBuf, state: Arc) { for event in events { if event.mask.contains(EventMask::MODIFY) { + if config_path.metadata().map(|m| m.len()).unwrap_or_default() == 0 { + continue; + } match Config::load(&config_path) { Ok(conf) => { let mut r = state.config.blocking_write(); -- cgit v1.2.3-70-g09d2