review changes

This commit is contained in:
mpostma 2021-06-10 15:55:44 +02:00
parent eb7616ca0f
commit 3ef0830c5d
6 changed files with 9 additions and 7 deletions

View file

@ -40,6 +40,8 @@ impl MapIndexStore {
#[async_trait::async_trait]
impl IndexStore for MapIndexStore {
async fn create(&self, uuid: Uuid, primary_key: Option<String>) -> IndexResult<Index> {
// We need to keep the lock until we are sure the db file has been opened correclty, to
// ensure that another db is not created at the same time.
let mut lock = self.index_store.write().await;
if let Some(index) = lock.get(&uuid) {

View file

@ -203,7 +203,7 @@ impl IndexController {
documents: Vec<String>,
) -> anyhow::Result<UpdateStatus> {
let uuid = self.uuid_resolver.get(uid).await?;
let meta = UpdateMeta::DeleteDocuments { documents };
let meta = UpdateMeta::DeleteDocuments { ids: documents };
let (_, receiver) = mpsc::channel(1);
let status = self.update_handle.update(meta, receiver, uuid).await?;
Ok(status)

View file

@ -174,7 +174,7 @@ impl UpdateStore {
Ok(Some(_)) => (),
Ok(None) => break,
Err(e) => {
error!("Fatal error while processing update that requires the update store to shutdown: {}", e);
error!("Fatal error while processing an update that requires the update store to shutdown: {}", e);
must_exit.store(true, Ordering::SeqCst);
break 'outer;
}
@ -185,9 +185,9 @@ impl UpdateStore {
}
}
}
});
error!("Update store loop exited.");
error!("Update store loop exited.");
});
Ok(update_store)
}

View file

@ -24,7 +24,7 @@ pub enum UpdateMeta {
},
ClearDocuments,
DeleteDocuments {
documents: Vec<String>
ids: Vec<String>
},
Settings(Settings<Unchecked>),
}