Can request sync thread stop
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user