This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new da9acd04fe3 [fix](http) Remove file if downloading faile is failed 
(#41778)
da9acd04fe3 is described below

commit da9acd04fe36266aef62c79687ccd1950a10d965
Author: walter <[email protected]>
AuthorDate: Mon Oct 14 21:43:26 2024 +0800

    [fix](http) Remove file if downloading faile is failed (#41778)
---
 be/src/http/http_client.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/be/src/http/http_client.cpp b/be/src/http/http_client.cpp
index e94614788f5..bf1cd751ae3 100644
--- a/be/src/http/http_client.cpp
+++ b/be/src/http/http_client.cpp
@@ -253,7 +253,13 @@ Status HttpClient::download(const std::string& local_path) 
{
         }
         return true;
     };
-    RETURN_IF_ERROR(execute(callback));
+
+    if (auto s = execute(callback); !s.ok()) {
+        status = s;
+    }
+    if (!status.ok()) {
+        remove(local_path.c_str());
+    }
     return status;
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to