From cdc4763ee429718c9d461f6ab0d10a81d49c9a8d Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 13 Dec 2024 16:44:16 +0800 Subject: [PATCH] Fix exists handling Signed-off-by: Xuanwo --- src/storage/drivers/opendal_adapter.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/storage/drivers/opendal_adapter.rs b/src/storage/drivers/opendal_adapter.rs index 23ee1ee7b..4fb1ca085 100644 --- a/src/storage/drivers/opendal_adapter.rs +++ b/src/storage/drivers/opendal_adapter.rs @@ -131,8 +131,14 @@ impl StoreDriver for OpendalAdapter { /// /// Returns a `StorageResult` with a boolean indicating the existence of the /// content. + /// + /// # TODO + /// + /// The `exists` function should return an error for issues such as permission denied. + /// However, these errors are not handled during the migration process and should be addressed + /// after the test suites are refactored. async fn exists(&self, path: &Path) -> StorageResult { let path = path.display().to_string(); - Ok(self.opendal_impl.exists(&path).await?) + Ok(self.opendal_impl.exists(&path).await.is_ok()) } }