mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-20 15:00:40 +00:00
@@ -66,7 +66,7 @@ pub enum Error {
|
||||
|
||||
#[snafu(display("Failed to initialize a watcher for file {}", path))]
|
||||
FileWatch {
|
||||
path: Option<String>,
|
||||
path: String,
|
||||
#[snafu(source)]
|
||||
error: notify::Error,
|
||||
},
|
||||
|
||||
@@ -45,13 +45,11 @@ impl WatchFileUserProvider {
|
||||
|
||||
let (tx, rx) = channel::<DebounceEventResult>();
|
||||
let mut debouncer = new_debouncer(Duration::from_secs(1), None, tx)
|
||||
.context(FileWatchSnafu { path: None })?;
|
||||
.context(FileWatchSnafu { path: "<none>" })?;
|
||||
debouncer
|
||||
.watcher()
|
||||
.watch(Path::new(filepath), RecursiveMode::NonRecursive)
|
||||
.context(FileWatchSnafu {
|
||||
path: Some(filepath),
|
||||
})?;
|
||||
.context(FileWatchSnafu { path: filepath })?;
|
||||
|
||||
let filepath = filepath.to_string();
|
||||
std::thread::spawn(move || {
|
||||
|
||||
@@ -451,7 +451,7 @@ pub enum Error {
|
||||
|
||||
#[snafu(display("Failed to initialize a watcher for file {}", path))]
|
||||
FileWatch {
|
||||
path: Option<String>,
|
||||
path: String,
|
||||
#[snafu(source)]
|
||||
error: notify::Error,
|
||||
},
|
||||
|
||||
@@ -200,20 +200,20 @@ pub fn maybe_watch_tls_config(tls_server_config: Arc<ReloadableTlsServerConfig>)
|
||||
let tls_server_config_for_watcher = tls_server_config.clone();
|
||||
|
||||
let (tx, rx) = channel::<notify::Result<notify::Event>>();
|
||||
let mut watcher = notify::recommended_watcher(tx).context(FileWatchSnafu { path: None })?;
|
||||
let mut watcher = notify::recommended_watcher(tx).context(FileWatchSnafu { path: "<none>" })?;
|
||||
|
||||
let cert_path = tls_server_config.get_tls_option().cert_path();
|
||||
watcher
|
||||
.watch(cert_path, RecursiveMode::NonRecursive)
|
||||
.context(FileWatchSnafu {
|
||||
path: Some(cert_path),
|
||||
.with_context(|_| FileWatchSnafu {
|
||||
path: cert_path.display().to_string(),
|
||||
})?;
|
||||
|
||||
let key_path = tls_server_config.get_tls_option().key_path();
|
||||
watcher
|
||||
.watch(key_path, RecursiveMode::NonRecursive)
|
||||
.context(FileWatchSnafu {
|
||||
path: Some(key_path),
|
||||
.with_context(|_| FileWatchSnafu {
|
||||
path: key_path.display().to_string(),
|
||||
})?;
|
||||
|
||||
std::thread::spawn(move || {
|
||||
|
||||
Reference in New Issue
Block a user