implement list all updates

This commit is contained in:
mpostma 2021-03-05 18:34:04 +01:00
parent c2282ab5cb
commit a9c7b73744
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
4 changed files with 80 additions and 40 deletions

View file

@ -107,7 +107,7 @@ impl IndexController {
}
pub async fn clear_documents(&self, index: String) -> anyhow::Result<UpdateStatus> {
let uuid = self.uuid_resolver.resolve(index).await.unwrap().unwrap();
let uuid = self.uuid_resolver.resolve(index).await?.unwrap();
let meta = UpdateMeta::ClearDocuments;
let (_, receiver) = mpsc::channel(1);
let status = self.update_handle.update(meta, receiver, uuid).await?;
@ -154,8 +154,12 @@ impl IndexController {
todo!()
}
fn all_update_status(&self, index: String) -> anyhow::Result<Vec<UpdateStatus>> {
todo!()
pub async fn all_update_status(&self, index: String) -> anyhow::Result<Vec<UpdateStatus>> {
let uuid = self.uuid_resolver
.resolve(index).await?
.context("index not found")?;
let result = self.update_handle.get_all_updates_status(uuid).await?;
Ok(result)
}
pub fn list_indexes(&self) -> anyhow::Result<Vec<IndexMetadata>> {