diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-26 09:38:36 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-27 11:24:20 +0200 |
commit | 76badf37b88c23081db72c206445d5f0bf4e28a4 (patch) | |
tree | 2376106b12c7664f80d9195e41371d3d31d0988d /src/other_tools/ops_maps | |
parent | 915d3f2b0119f8bd31d026e686dbaf9124186e61 (diff) | |
download | justbuild-76badf37b88c23081db72c206445d5f0bf4e28a4.tar.gz |
Pass ServeApi to just-mr maps by raw pointer
...since it is used for capturing in lambdas for AsyncMaps and mustn't be temporary.
Diffstat (limited to 'src/other_tools/ops_maps')
-rw-r--r-- | src/other_tools/ops_maps/content_cas_map.cpp | 8 | ||||
-rw-r--r-- | src/other_tools/ops_maps/content_cas_map.hpp | 2 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_tree_fetch_map.cpp | 8 | ||||
-rw-r--r-- | src/other_tools/ops_maps/git_tree_fetch_map.hpp | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/other_tools/ops_maps/content_cas_map.cpp b/src/other_tools/ops_maps/content_cas_map.cpp index 4e526bc7..651e83fb 100644 --- a/src/other_tools/ops_maps/content_cas_map.cpp +++ b/src/other_tools/ops_maps/content_cas_map.cpp @@ -108,7 +108,7 @@ auto CreateContentCASMap( MirrorsPtr const& additional_mirrors, CAInfoPtr const& ca_info, gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, - std::optional<ServeApi> const& serve, + ServeApi const* serve, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, std::size_t jobs) -> ContentCASMap { @@ -116,7 +116,7 @@ auto CreateContentCASMap( additional_mirrors, ca_info, critical_git_op_map, - &serve, + serve, local_api, remote_api](auto ts, auto setter, @@ -149,7 +149,7 @@ auto CreateContentCASMap( just_mr_paths, additional_mirrors, ca_info, - &serve, + serve, local_api, remote_api, setter, @@ -215,7 +215,7 @@ auto CreateContentCASMap( return; } // check if content is known to remote serve service - if (serve and remote_api != nullptr and + if (serve != nullptr and remote_api != nullptr and serve->ContentInRemoteCAS(key.content)) { // try to get content from remote CAS if (remote_api->RetrieveToCas( diff --git a/src/other_tools/ops_maps/content_cas_map.hpp b/src/other_tools/ops_maps/content_cas_map.hpp index f0d0369b..049edc5f 100644 --- a/src/other_tools/ops_maps/content_cas_map.hpp +++ b/src/other_tools/ops_maps/content_cas_map.hpp @@ -84,7 +84,7 @@ using ContentCASMap = AsyncMapConsumer<ArchiveContent, std::nullptr_t>; MirrorsPtr const& additional_mirrors, CAInfoPtr const& ca_info, gsl::not_null<CriticalGitOpMap*> const& critical_git_op_map, - std::optional<ServeApi> const& serve, + ServeApi const* serve, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, std::size_t jobs) -> ContentCASMap; diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.cpp b/src/other_tools/ops_maps/git_tree_fetch_map.cpp index 50433b20..d56c79c7 100644 --- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp +++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp @@ -128,7 +128,7 @@ auto CreateGitTreeFetchMap( gsl::not_null<ImportToGitMap*> const& import_to_git_map, std::string const& git_bin, std::vector<std::string> const& launcher, - std::optional<ServeApi> const& serve, + ServeApi const* serve, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, bool backup_to_remote, @@ -137,7 +137,7 @@ auto CreateGitTreeFetchMap( import_to_git_map, git_bin, launcher, - &serve, + serve, local_api, remote_api, backup_to_remote](auto ts, @@ -163,7 +163,7 @@ auto CreateGitTreeFetchMap( import_to_git_map, git_bin, launcher, - &serve, + serve, local_api, remote_api, backup_to_remote, @@ -231,7 +231,7 @@ auto CreateGitTreeFetchMap( JustMRProgress::Instance().TaskTracker().Start(key.origin); // check if tree is known to remote serve service and can be // made available in remote CAS - if (serve and remote_api != nullptr) { + if (serve != nullptr and remote_api != nullptr) { // as we anyway interrogate the remote execution endpoint, // we're only interested here in the serve endpoint making // an attempt to upload the tree, if known, to remote CAS diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.hpp b/src/other_tools/ops_maps/git_tree_fetch_map.hpp index 342629ab..4a8ab527 100644 --- a/src/other_tools/ops_maps/git_tree_fetch_map.hpp +++ b/src/other_tools/ops_maps/git_tree_fetch_map.hpp @@ -60,7 +60,7 @@ using GitTreeFetchMap = AsyncMapConsumer<GitTreeInfo, bool>; gsl::not_null<ImportToGitMap*> const& import_to_git_map, std::string const& git_bin, std::vector<std::string> const& launcher, - std::optional<ServeApi> const& serve, + ServeApi const* serve, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, bool backup_to_remote, |