diff options
Diffstat (limited to 'src/other_tools/just_mr/fetch.cpp')
-rw-r--r-- | src/other_tools/just_mr/fetch.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp index 99fd9f62..ebba56e5 100644 --- a/src/other_tools/just_mr/fetch.cpp +++ b/src/other_tools/just_mr/fetch.cpp @@ -19,7 +19,6 @@ #include <utility> // std::move #include "fmt/core.h" -#include "gsl/gsl" #include "nlohmann/json.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" #include "src/buildtool/execution_api/local/local_api.hpp" @@ -402,23 +401,24 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config, bool remote_compatible{common_args.compatible == true}; // setup the API for serving roots - std::optional<gsl::not_null<const ServeApi*>> serve; - if (JustMR::Utils::SetupServeApi(common_args.remote_serve_address, - auth_args)) { - serve = &ServeApi::Instance(); - } + bool serve_api_exists = JustMR::Utils::SetupServeApi( + common_args.remote_serve_address, auth_args); + + auto serve = serve_api_exists + ? ServeApi::Create(RemoteServeConfig::Instance()) + : std::nullopt; // check configuration of the serve endpoint provided if (serve) { // if we have a remote endpoint explicitly given by the user, it must // match what the serve endpoint expects if (remote_api and common_args.remote_execution_address and - not(*serve)->CheckServeRemoteExecution()) { + not serve->CheckServeRemoteExecution()) { return kExitFetchError; // this check logs error on failure } // check the compatibility mode of the serve endpoint - auto compatible = (*serve)->IsCompatible(); + auto compatible = serve->IsCompatible(); if (not compatible) { Logger::Log(LogLevel::Warning, "Checking compatibility configuration of the provided " |