diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-12-05 17:29:30 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-12-06 11:57:16 +0100 |
commit | 8739f2bb6e07321c4e92e5610f92785cae950ff7 (patch) | |
tree | 95e633e16ff45b2a76769c8608d5652d67bb83c4 /src/buildtool/serve_api/remote/config.hpp | |
parent | ef2da9cbe1d55fd9667ad7fe42792ffd8ed0ec50 (diff) | |
download | justbuild-8739f2bb6e07321c4e92e5610f92785cae950ff7.tar.gz |
just serve: make tc write strategy configurable
Diffstat (limited to 'src/buildtool/serve_api/remote/config.hpp')
-rw-r--r-- | src/buildtool/serve_api/remote/config.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/buildtool/serve_api/remote/config.hpp b/src/buildtool/serve_api/remote/config.hpp index 94f00f8e..8978565b 100644 --- a/src/buildtool/serve_api/remote/config.hpp +++ b/src/buildtool/serve_api/remote/config.hpp @@ -21,6 +21,7 @@ #include <vector> #include "src/buildtool/common/remote/remote_common.hpp" +#include "src/buildtool/main/build_utils.hpp" class RemoteServeConfig { public: @@ -65,6 +66,10 @@ class RemoteServeConfig { return Instance().timeout_ > std::chrono::seconds{0}; } + static void SetTCStrategy(TargetCacheWriteStrategy strategy) noexcept { + Instance().tc_strategy_ = strategy; + } + // Remote execution address, if set [[nodiscard]] static auto RemoteAddress() noexcept -> std::optional<ServerAddress> { @@ -93,6 +98,12 @@ class RemoteServeConfig { return Instance().timeout_; } + // Get the target-level cache write strategy + [[nodiscard]] static auto TCStrategy() noexcept + -> TargetCacheWriteStrategy { + return Instance().tc_strategy_; + } + private: // Server address of remote execution. std::optional<ServerAddress> remote_address_{}; @@ -108,6 +119,9 @@ class RemoteServeConfig { // Action timeout std::chrono::milliseconds timeout_{}; + + // Strategy for synchronizing target-level cache + TargetCacheWriteStrategy tc_strategy_{TargetCacheWriteStrategy::Sync}; }; #endif // INCLUDED_SRC_BUILDTOOL_SERVE_API_REMOTE_CONFIG_HPP |