Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions fact/src/output/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ impl Client {
return Ok(false);
}

if let Ok(true) = self.config.has_changed() {
// Configuration changed while we were attempting to
// reconnect, bail and let the top level deal with this.
return Ok(true);
}

// Re-read certs on each connection attempt so rotated certificates
// on disk are picked up on the next reconnect.
let connector = self.get_connector().await?;
Expand Down Expand Up @@ -268,8 +274,8 @@ impl Client {
}
}

pub(super) fn is_enabled(&self) -> bool {
self.config.borrow().url().is_some()
pub(super) fn is_enabled(&mut self) -> bool {
self.config.borrow_and_update().url().is_some()
}

async fn idle(&mut self) -> anyhow::Result<bool> {
Expand Down
2 changes: 1 addition & 1 deletion fact/src/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn start(
let (running, _) = watch::channel(true);
let mut handles = JoinSet::new();

let grpc_client = grpc::Client::new(
let mut grpc_client = grpc::Client::new(
subs_req.clone(),
running.subscribe(),
metrics.grpc.clone(),
Expand Down
Loading
Loading