Skip to content

Commit 39d1ac5

Browse files
Update crates/terraphim_agent_application/src/application.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a2e5298 commit 39d1ac5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

crates/terraphim_agent_application/src/application.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,14 @@ impl Application for TerraphimAgentApplication {
474474
}
475475

476476
// Start configuration hot reloading
477-
let mut config_manager =
478-
Arc::try_unwrap(self.config_manager.clone()).unwrap_or_else(|arc| (*arc).clone());
479-
config_manager.start_hot_reload().await?;
480-
self.config_manager = Arc::new(config_manager);
477+
if let Some(config_manager) = Arc::get_mut(&mut self.config_manager) {
478+
config_manager.start_hot_reload().await?;
479+
} else {
480+
error!("Failed to get mutable reference to ConfigurationManager; multiple references exist.");
481+
return Err(ApplicationError::ConfigurationError(
482+
"Cannot start hot reload: ConfigurationManager is shared".to_string(),
483+
));
484+
}
481485

482486
// Start system message handler
483487
self.start_message_handler().await?;

0 commit comments

Comments
 (0)