mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-12 07:36:29 +00:00
fixes after review
This commit is contained in:
@ -72,9 +72,6 @@ where
|
||||
Some(Snapshot { uuid, path, ret }) => {
|
||||
let _ = ret.send(self.handle_snapshot(uuid, path).await);
|
||||
}
|
||||
Some(IsLocked { uuid, ret }) => {
|
||||
let _ = ret.send(self.handle_is_locked(uuid).await);
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
@ -226,14 +223,4 @@ where
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn handle_is_locked(&self, uuid: Uuid) -> Result<bool> {
|
||||
let store = self
|
||||
.store
|
||||
.get(uuid)
|
||||
.await?
|
||||
.ok_or(UpdateError::UnexistingIndex(uuid))?;
|
||||
|
||||
Ok(store.update_lock.is_locked())
|
||||
}
|
||||
}
|
||||
|
@ -95,11 +95,4 @@ where
|
||||
let _ = self.sender.send(msg).await;
|
||||
receiver.await.expect("update actor killed.")
|
||||
}
|
||||
|
||||
async fn is_locked(&self, uuid: Uuid) -> Result<bool> {
|
||||
let (ret, receiver) = oneshot::channel();
|
||||
let msg = UpdateMsg::IsLocked { uuid, ret };
|
||||
let _ = self.sender.send(msg).await;
|
||||
receiver.await.expect("update actor killed.")
|
||||
}
|
||||
}
|
||||
|
@ -34,8 +34,4 @@ pub enum UpdateMsg<D> {
|
||||
path: PathBuf,
|
||||
ret: oneshot::Sender<Result<()>>,
|
||||
},
|
||||
IsLocked {
|
||||
uuid: Uuid,
|
||||
ret: oneshot::Sender<Result<bool>>,
|
||||
},
|
||||
}
|
||||
|
@ -52,5 +52,4 @@ pub trait UpdateActorHandle {
|
||||
data: mpsc::Receiver<PayloadData<Self::Data>>,
|
||||
uuid: Uuid,
|
||||
) -> Result<UpdateStatus>;
|
||||
async fn is_locked(&self, uuid: Uuid) -> Result<bool>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user