clean index actor unwraps

This commit is contained in:
mpostma 2021-03-08 15:53:16 +01:00
parent 2f93cce7aa
commit 06403a5708
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
4 changed files with 113 additions and 97 deletions

View file

@ -69,11 +69,11 @@ enum IndexControllerMsg {
}
impl IndexController {
pub fn new(path: impl AsRef<Path>) -> Self {
pub fn new(path: impl AsRef<Path>) -> anyhow::Result<Self> {
let uuid_resolver = uuid_resolver::UuidResolverHandle::new();
let index_actor = index_actor::IndexActorHandle::new(&path);
let index_actor = index_actor::IndexActorHandle::new(&path)?;
let update_handle = update_actor::UpdateActorHandle::new(index_actor.clone(), &path);
Self { uuid_resolver, index_handle: index_actor, update_handle }
Ok(Self { uuid_resolver, index_handle: index_actor, update_handle })
}
pub async fn add_documents(