Can get sync thread status

This commit is contained in:
2025-11-19 16:34:00 +01:00
parent 1e00d24a8b
commit 7b691962a0
4 changed files with 38 additions and 3 deletions

View File

@@ -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 }))
}