From 564e606ac7c6b34f3029e9b912797853666f3eef Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 19 Nov 2025 17:15:54 +0100 Subject: [PATCH] Properly handle start sync thread issue --- .../src/matrix_connection/matrix_manager.rs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/matrixgw_backend/src/matrix_connection/matrix_manager.rs b/matrixgw_backend/src/matrix_connection/matrix_manager.rs index 68415b9..77fc707 100644 --- a/matrixgw_backend/src/matrix_connection/matrix_manager.rs +++ b/matrixgw_backend/src/matrix_connection/matrix_manager.rs @@ -39,6 +39,15 @@ impl Actor for MatrixManagerActor { }) } + async fn post_stop( + &self, + _myself: ActorRef, + _state: &mut Self::State, + ) -> Result<(), ActorProcessingErr> { + log::error!("[!] [!] Matrix Manager Actor stopped!"); + Ok(()) + } + async fn handle( &self, myself: ActorRef, @@ -115,8 +124,15 @@ impl Actor for MatrixManagerActor { // Start thread log::debug!("Starting sync thread for {email:?}"); let thread_id = - start_sync_thread(client.clone(), state.broadcast_sender.clone(), myself) - .await?; + match start_sync_thread(client.clone(), state.broadcast_sender.clone(), myself) + .await + { + Ok(thread_id) => thread_id, + Err(e) => { + log::error!("Failed to start sync thread! {e}"); + return Ok(()); + } + }; state.running_sync_threads.insert(email, thread_id); } MatrixManagerMsg::StopSyncThread(email) => {