summaryrefslogtreecommitdiff
path: root/src/buildtool/main/main.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-16 16:53:36 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-19 09:50:37 +0200
commit741773f63fa24d2c862db32cb46a0edfbd69968b (patch)
treeb913390c2ab42ffd4d155143013d8ecd01aa952d /src/buildtool/main/main.cpp
parent0b848592a8d84e3b3bda23584308ab24965e55ca (diff)
downloadjustbuild-741773f63fa24d2c862db32cb46a0edfbd69968b.tar.gz
just: Move RetryConfig setup before starting just serve
As the serve endpoint acts also as a regular client to its associated remote-execution endpoint, it should employ the same retry strategy as the regular just client. Also updates ReadJustServeConfig to store the retry config arguments instead of calling the RetryConfig singleton setters directly, thus clearly separating the reading of the arguments from the creation of any configuration singleton/instance.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r--src/buildtool/main/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 5e9ff7b8..1d6dafeb 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -855,6 +855,12 @@ auto main(int argc, char* argv[]) -> int {
return kExitFailure;
}
+ // Set up the retry arguments, needed only for the client-side logic of
+ // remote execution, i.e., just serve and the regular just client.
+ if (not SetupRetryConfig(arguments.retry)) {
+ return kExitFailure;
+ }
+
if (arguments.cmd == SubCommand::kServe) {
auto serve_server =
ServeServerImpl::Create(arguments.service.interface,
@@ -973,9 +979,6 @@ auto main(int argc, char* argv[]) -> int {
Progress progress{};
#ifndef BOOTSTRAP_BUILD_TOOL
- if (not SetupRetryConfig(arguments.retry)) {
- std::exit(kExitFailure);
- }
ApiBundle const main_apis{&*storage_config,
&storage,
&*local_exec_config,