From 978de9de55d9592c258052dd52dc25c788a89d78 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 8 Jul 2024 11:28:13 +0200 Subject: Remove the LocalExecutionConfig singleton ...and replace it with passed instances created early via a builder pattern. --- src/other_tools/just_mr/setup_utils.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/other_tools/just_mr/setup_utils.cpp') diff --git a/src/other_tools/just_mr/setup_utils.cpp b/src/other_tools/just_mr/setup_utils.cpp index 2c219d95..ae6f5a28 100644 --- a/src/other_tools/just_mr/setup_utils.cpp +++ b/src/other_tools/just_mr/setup_utils.cpp @@ -217,6 +217,22 @@ auto CreateAuthConfig(MultiRepoRemoteAuthArguments const& authargs) noexcept return Auth{}; } +auto CreateLocalExecutionConfig(MultiRepoCommonArguments const& cargs) noexcept + -> std::optional { + + LocalExecutionConfig::Builder builder; + if (cargs.local_launcher.has_value()) { + builder.SetLauncher(*cargs.local_launcher); + } + + auto config = builder.Build(); + if (config) { + return *std::move(config); + } + Logger::Log(LogLevel::Error, config.error()); + return std::nullopt; +} + void SetupRemoteConfig( std::optional const& remote_exec_addr, std::optional const& remote_serve_addr) noexcept { -- cgit v1.2.3