diff options
Diffstat (limited to 'src/other_tools/ops_maps/archive_fetch_map.cpp')
-rw-r--r-- | src/other_tools/ops_maps/archive_fetch_map.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/other_tools/ops_maps/archive_fetch_map.cpp b/src/other_tools/ops_maps/archive_fetch_map.cpp index f04d43f4..17b33092 100644 --- a/src/other_tools/ops_maps/archive_fetch_map.cpp +++ b/src/other_tools/ops_maps/archive_fetch_map.cpp @@ -19,8 +19,6 @@ #include "fmt/core.h" #include "src/buildtool/file_system/file_storage.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" -#include "src/other_tools/just_mr/progress_reporting/progress.hpp" -#include "src/other_tools/just_mr/progress_reporting/statistics.hpp" #include "src/other_tools/just_mr/utils.hpp" namespace { @@ -30,6 +28,7 @@ void ProcessContent(std::filesystem::path const& content_path, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, std::string const& content, + gsl::not_null<JustMRStatistics*> const& stats, ArchiveFetchMap::SetterPtr const& setter, ArchiveFetchMap::LoggerPtr const& logger) { // try to back up to remote CAS @@ -60,7 +59,7 @@ void ProcessContent(std::filesystem::path const& content_path, return; } // success - JustMRStatistics::Instance().IncrementExecutedCounter(); + stats->IncrementExecutedCounter(); (*setter)(true); } @@ -71,16 +70,18 @@ auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map, gsl::not_null<Storage const*> const& storage, gsl::not_null<IExecutionApi const*> const& local_api, IExecutionApi const* remote_api, + gsl::not_null<JustMRStatistics*> const& stats, std::size_t jobs) -> ArchiveFetchMap { auto fetch_archive = [content_cas_map, fetch_dir, storage, local_api, - remote_api](auto ts, - auto setter, - auto logger, - auto /* unused */, - auto const& key) { + remote_api, + stats](auto ts, + auto setter, + auto logger, + auto /* unused */, + auto const& key) { // get corresponding distfile auto distfile = (key.distfile @@ -96,6 +97,7 @@ auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map, local_api, remote_api, content = key.content, + stats, setter, logger]([[maybe_unused]] auto const& values) { // content is in local CAS now @@ -109,6 +111,7 @@ auto CreateArchiveFetchMap(gsl::not_null<ContentCASMap*> const& content_cas_map, local_api, remote_api, content, + stats, setter, logger); }, |