From fa742f60e8d1daa9a9b570cc1506fd014db647de Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 7 Sep 2022 20:33:33 +0200 Subject: [PATCH] make the file store entirely synchronous, including the file deletion --- index-scheduler/src/update_file_store.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index-scheduler/src/update_file_store.rs b/index-scheduler/src/update_file_store.rs index cb4eadf4d..143279c37 100644 --- a/index-scheduler/src/update_file_store.rs +++ b/index-scheduler/src/update_file_store.rs @@ -178,9 +178,9 @@ mod store { 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()); - tokio::fs::remove_file(path).await?; + std::fs::remove_file(path)?; Ok(()) } } @@ -248,9 +248,9 @@ mod test { } } - pub async fn delete(&self, uuid: Uuid) -> Result<()> { + pub fn delete(&self, uuid: Uuid) -> Result<()> { match self { - MockUpdateFileStore::Real(s) => s.delete(uuid).await, + MockUpdateFileStore::Real(s) => s.delete(uuid), MockUpdateFileStore::Mock(mocker) => unsafe { mocker.get("delete").call(uuid) }, } }