From dc9a7b8499da9ce7a90546afecd048d0bfb31f38 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 13 Jun 2024 10:16:29 +0200 Subject: Make ServeApi a general class, not a singleton ...and adjust interfaces. --- src/other_tools/ops_maps/content_cas_map.cpp | 8 ++++---- src/other_tools/ops_maps/content_cas_map.hpp | 2 +- src/other_tools/ops_maps/git_tree_fetch_map.cpp | 8 ++++---- src/other_tools/ops_maps/git_tree_fetch_map.hpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/other_tools/ops_maps') diff --git a/src/other_tools/ops_maps/content_cas_map.cpp b/src/other_tools/ops_maps/content_cas_map.cpp index 527bd7de..97e959d4 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 const& critical_git_op_map, - std::optional> const& serve, + std::optional const& serve, gsl::not_null const& local_api, std::optional> 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, @@ -216,7 +216,7 @@ auto CreateContentCASMap( } // check if content is known to remote serve service if (serve and remote_api and - (*serve)->ContentInRemoteCAS(key.content)) { + serve->ContentInRemoteCAS(key.content)) { // try to get content from remote CAS if (remote_api.value()->RetrieveToCas( {Artifact::ObjectInfo{.digest = digest, diff --git a/src/other_tools/ops_maps/content_cas_map.hpp b/src/other_tools/ops_maps/content_cas_map.hpp index 9e8d9f46..0fb66970 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; MirrorsPtr const& additional_mirrors, CAInfoPtr const& ca_info, gsl::not_null const& critical_git_op_map, - std::optional> const& serve, + std::optional const& serve, gsl::not_null const& local_api, std::optional> 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 10095045..b99c7814 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 const& import_to_git_map, std::string const& git_bin, std::vector const& launcher, - std::optional> const& serve, + std::optional const& serve, gsl::not_null const& local_api, std::optional> 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, @@ -235,7 +235,7 @@ auto CreateGitTreeFetchMap( // 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 - std::ignore = (*serve)->TreeInRemoteCAS(key.hash); + std::ignore = serve->TreeInRemoteCAS(key.hash); } // check if tree is in remote CAS, if a remote is given if (remote_api and 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 3f6e6769..93ca450f 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; gsl::not_null const& import_to_git_map, std::string const& git_bin, std::vector const& launcher, - std::optional> const& serve, + std::optional const& serve, gsl::not_null const& local_api, std::optional> const& remote_api, bool backup_to_remote, -- cgit v1.2.3