File tree Expand file tree Collapse file tree
crates/terraphim_agent_application/src Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ?;
You can’t perform that action at this time.
0 commit comments