diff options
Diffstat (limited to 'src/other_tools/just_mr/setup_utils.cpp')
-rw-r--r-- | src/other_tools/just_mr/setup_utils.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/other_tools/just_mr/setup_utils.cpp b/src/other_tools/just_mr/setup_utils.cpp index ae6f5a28..4e5e5ad3 100644 --- a/src/other_tools/just_mr/setup_utils.cpp +++ b/src/other_tools/just_mr/setup_utils.cpp @@ -233,23 +233,23 @@ auto CreateLocalExecutionConfig(MultiRepoCommonArguments const& cargs) noexcept return std::nullopt; } -void SetupRemoteConfig( +auto CreateRemoteExecutionConfig( std::optional<std::string> const& remote_exec_addr, - std::optional<std::string> const& remote_serve_addr) noexcept { + std::optional<std::string> const& remote_serve_addr) noexcept + -> std::optional<RemoteExecutionConfig> { // if only a serve endpoint address is given, we assume it is one that acts // also as remote-execution auto remote_addr = remote_exec_addr ? remote_exec_addr : remote_serve_addr; - if (not remote_addr) { - return; - } - // setup remote - if (not RemoteExecutionConfig::SetRemoteAddress(*remote_addr)) { - Logger::Log(LogLevel::Error, - "setting remote execution address '{}' failed.", - *remote_addr); - std::exit(kExitConfigError); + RemoteExecutionConfig::Builder builder; + auto config = builder.SetRemoteAddress(remote_addr).Build(); + + if (config) { + return *std::move(config); } + + Logger::Log(LogLevel::Error, config.error()); + return std::nullopt; } auto CreateServeConfig( |