Can get sync thread status
This commit is contained in:
@@ -37,3 +37,23 @@ pub async fn stop_sync(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct GetSyncStatusResponse {
|
||||
started: bool,
|
||||
}
|
||||
|
||||
/// Get sync thread status
|
||||
pub async fn status(
|
||||
client: MatrixClientExtractor,
|
||||
manager: web::Data<ActorRef<MatrixManagerMsg>>,
|
||||
) -> HttpResult {
|
||||
let started = ractor::call!(
|
||||
manager.as_ref(),
|
||||
MatrixManagerMsg::SyncThreadGetStatus,
|
||||
client.auth.user.email
|
||||
)
|
||||
.expect("RPC to Matrix Manager failed");
|
||||
|
||||
Ok(HttpResponse::Ok().json(GetSyncStatusResponse { started }))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user