mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-29 16:24:26 +01:00
make the file store entirely synchronous, including the file deletion
This commit is contained in:
parent
a7aa92df5f
commit
fa742f60e8
@ -178,9 +178,9 @@ mod store {
|
|||||||
Ok(self.get_update(uuid)?.metadata()?.len())
|
Ok(self.get_update(uuid)?.metadata()?.len())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn delete(&self, uuid: Uuid) -> Result<()> {
|
pub fn delete(&self, uuid: Uuid) -> Result<()> {
|
||||||
let path = self.path.join(uuid.to_string());
|
let path = self.path.join(uuid.to_string());
|
||||||
tokio::fs::remove_file(path).await?;
|
std::fs::remove_file(path)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,9 +248,9 @@ mod test {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn delete(&self, uuid: Uuid) -> Result<()> {
|
pub fn delete(&self, uuid: Uuid) -> Result<()> {
|
||||||
match self {
|
match self {
|
||||||
MockUpdateFileStore::Real(s) => s.delete(uuid).await,
|
MockUpdateFileStore::Real(s) => s.delete(uuid),
|
||||||
MockUpdateFileStore::Mock(mocker) => unsafe { mocker.get("delete").call(uuid) },
|
MockUpdateFileStore::Mock(mocker) => unsafe { mocker.get("delete").call(uuid) },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user