Can request sync thread stop

This commit is contained in:
2025-11-19 15:51:15 +01:00
parent cfdf98b47a
commit 1e00d24a8b
3 changed files with 31 additions and 0 deletions

View File

@@ -20,3 +20,20 @@ pub async fn start_sync(
}
}
}
/// Stop sync thread
pub async fn stop_sync(
client: MatrixClientExtractor,
manager: web::Data<ActorRef<MatrixManagerMsg>>,
) -> HttpResult {
match ractor::cast!(
manager,
MatrixManagerMsg::StopSyncThread(client.auth.user.email.clone())
) {
Ok(_) => Ok(HttpResponse::Accepted().finish()),
Err(e) => {
log::error!("Failed to stop sync thread: {e}");
Ok(HttpResponse::InternalServerError().finish())
}
}
}