diff --git a/Cargo.lock b/Cargo.lock index c4d767e3..fa0df8e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2335,9 +2335,9 @@ dependencies = [ [[package]] name = "notify" -version = "5.0.0-pre.14" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d13c22db70a63592e098fb51735bab36646821e6389a0ba171f3549facdf0b74" +checksum = "ed2c66da08abae1c024c01d635253e402341b4060a12e99b31c7594063bf490a" dependencies = [ "bitflags", "crossbeam-channel", diff --git a/warpgate/Cargo.toml b/warpgate/Cargo.toml index 9461314c..8cda7bc5 100644 --- a/warpgate/Cargo.toml +++ b/warpgate/Cargo.toml @@ -18,7 +18,7 @@ data-encoding = "2.3" dhat = {version = "0.3", optional = true} dialoguer = "0.10" futures = "0.3" -notify = "^5.0.0-beta.1" +notify = "^5.0.0" qrcode = "0.12" rcgen = {version = "0.9", features = ["zeroize"]} serde_json = "1.0" diff --git a/warpgate/src/config.rs b/warpgate/src/config.rs index bf2a10ef..a4f17a59 100644 --- a/warpgate/src/config.rs +++ b/warpgate/src/config.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::{Context, Result}; use config::{Config, Environment, File}; -use notify::{RecommendedWatcher, RecursiveMode, Watcher}; +use notify::{RecursiveMode, Watcher, recommended_watcher}; use tokio::sync::{broadcast, mpsc, Mutex}; use tracing::*; use warpgate_common::helpers::fs::secure_file; @@ -77,10 +77,9 @@ pub fn watch_config + Send + 'static>( config: Arc>, ) -> Result> { let (tx, mut rx) = mpsc::channel(16); - let mut watcher = RecommendedWatcher::new(move |res| { + let mut watcher = recommended_watcher(move |res| { let _ = tx.blocking_send(res); })?; - watcher.configure(notify::Config::PreciseEvents(true))?; watcher.watch(path.as_ref(), RecursiveMode::NonRecursive)?; let path = PathBuf::from(path.as_ref());