Skip to content

Commit 8d77531

Browse files
committed
Added log lines
1 parent 0bdaacb commit 8d77531

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

crates/pbs/src/service.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,20 @@ impl PbsService {
6868
let config_path_for_watcher = config_path.clone();
6969
watcher = RecommendedWatcher::new(
7070
move |result: Result<Event, Error>| {
71-
let event = result.unwrap();
72-
if !event.kind.is_modify() {
73-
return;
71+
match result {
72+
Err(e) => {
73+
warn!(%e, "error watching PBS config file for changes");
74+
return;
75+
}
76+
Ok(event) => {
77+
if !event.kind.is_modify() {
78+
return;
79+
}
80+
}
7481
}
7582

7683
// Reload the configuration when the file is modified
84+
info!("detected change in PBS config file, reloading configuration");
7785
let result = futures::executor::block_on(load_pbs_config(Some(
7886
config_path_for_watcher.to_path_buf(),
7987
)));
@@ -91,6 +99,7 @@ impl PbsService {
9199
notify::Config::default(),
92100
)?;
93101
watcher.watch(config_path.as_path(), RecursiveMode::Recursive)?;
102+
info!("watching PBS config file for changes: {:?}", config_path);
94103
}
95104

96105
// Run the registry refresher task

0 commit comments

Comments
 (0)