Properly handle start sync thread issue
This commit is contained in:
@@ -39,6 +39,15 @@ impl Actor for MatrixManagerActor {
|
||||
})
|
||||
}
|
||||
|
||||
async fn post_stop(
|
||||
&self,
|
||||
_myself: ActorRef<Self::Msg>,
|
||||
_state: &mut Self::State,
|
||||
) -> Result<(), ActorProcessingErr> {
|
||||
log::error!("[!] [!] Matrix Manager Actor stopped!");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn handle(
|
||||
&self,
|
||||
myself: ActorRef<Self::Msg>,
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user