From 33907a1d3284a2df27994f7da1ef65d3047f165f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 16 Jul 2024 07:14:06 +0100 Subject: [PATCH] feat: reload server config when file is touched Closes kemitix/git-next#84 --- crates/file-watcher-actor/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/file-watcher-actor/src/lib.rs b/crates/file-watcher-actor/src/lib.rs index fce74a57..2bdb1404 100644 --- a/crates/file-watcher-actor/src/lib.rs +++ b/crates/file-watcher-actor/src/lib.rs @@ -57,7 +57,9 @@ impl Handler for FileWatcher { fn handle(&mut self, _msg: WatchFile, _ctx: &mut Self::Context) -> Self::Result { let mut buffer = [0u8; 4096]; if let Ok(mut events) = self.inotify.read_events(&mut buffer) { - if events.any(|event| event.mask.contains(EventMask::MODIFY)) { + if events.any(|event| { + event.mask.contains(EventMask::MODIFY) || event.mask.contains(EventMask::ATTRIB) + }) { tracing::info!("File modified"); self.recipient.do_send(FileUpdated); };