From 866391f5436488cec823ad6bc0a446c0c9d70625 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 13 Jun 2024 13:06:09 +0200 Subject: Create an individual instance of RemoteServeConfig in just-mr ...instead of initialization of the singleton. --- src/other_tools/just_mr/fetch.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/other_tools/just_mr/fetch.cpp') diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp index ebba56e5..0f0a0ef1 100644 --- a/src/other_tools/just_mr/fetch.cpp +++ b/src/other_tools/just_mr/fetch.cpp @@ -401,13 +401,13 @@ auto MultiRepoFetch(std::shared_ptr const& config, bool remote_compatible{common_args.compatible == true}; // setup the API for serving roots - bool serve_api_exists = JustMR::Utils::SetupServeApi( + auto serve_config = JustMR::Utils::CreateServeConfig( common_args.remote_serve_address, auth_args); + if (not serve_config) { + return kExitConfigError; + } - auto serve = serve_api_exists - ? ServeApi::Create(RemoteServeConfig::Instance()) - : std::nullopt; - + auto serve = ServeApi::Create(*serve_config); // check configuration of the serve endpoint provided if (serve) { // if we have a remote endpoint explicitly given by the user, it must -- cgit v1.2.3