summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buildtool/execution_api/local/local_api.cpp15
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_response.cpp10
2 files changed, 3 insertions, 22 deletions
diff --git a/src/buildtool/execution_api/local/local_api.cpp b/src/buildtool/execution_api/local/local_api.cpp
index 6f3d48e7..81fb4bed 100644
--- a/src/buildtool/execution_api/local/local_api.cpp
+++ b/src/buildtool/execution_api/local/local_api.cpp
@@ -181,21 +181,10 @@ auto LocalApi::RetrieveToCas(
if (not blob.has_value()) {
return false;
}
-
- // Collect blob and upload to remote CAS if transfer size reached.
- if (not UpdateContainerAndUpload(
- &container,
- *std::move(blob),
- /*exception_is_fatal=*/true,
- [&api](std::unordered_set<ArtifactBlob>&& blobs) {
- return api.Upload(std::move(blobs),
- /*skip_find_missing=*/true);
- })) {
- return false;
- }
+ container.emplace(*std::move(blob));
}
- // Upload remaining blobs to remote CAS.
+ // Upload blobs to remote CAS.
return api.Upload(std::move(container), /*skip_find_missing=*/true);
}
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp
index d0429cd7..ffede579 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp
@@ -286,21 +286,13 @@ auto BazelResponse::UploadTreeMessageDirectories(
return network.UploadBlobs(std::move(blobs));
};
auto const hash_function = network_->GetHashFunction();
- std::unordered_set<ArtifactBlob> dir_blobs{};
auto rootdir_blob = ProcessDirectoryMessage(hash_function, tree.root());
if (not rootdir_blob) {
return unexpected{std::move(rootdir_blob).error()};
}
auto const root_digest = rootdir_blob->GetDigest();
- // store or upload rootdir blob, taking maximum transfer size into account
- if (not UpdateContainerAndUpload(&dir_blobs,
- *std::move(rootdir_blob),
- /*exception_is_fatal=*/false,
- upload_callback)) {
- return unexpected{fmt::format(
- "failed to upload Tree with root digest {}", root_digest.hash())};
- }
+ std::unordered_set<ArtifactBlob> dir_blobs{*std::move(rootdir_blob)};
for (auto const& subdir : tree.children()) {
// store or upload blob, taking maximum transfer size into account