mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-12-11 15:36:20 +08:00
bumped notify
This commit is contained in:
parent
d880da0fdf
commit
8e393e660c
3 changed files with 5 additions and 6 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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<P: AsRef<Path> + Send + 'static>(
|
|||
config: Arc<Mutex<WarpgateConfig>>,
|
||||
) -> Result<broadcast::Receiver<()>> {
|
||||
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());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue