From 8739f2bb6e07321c4e92e5610f92785cae950ff7 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 5 Dec 2023 17:29:30 +0100 Subject: just serve: make tc write strategy configurable --- src/buildtool/serve_api/remote/config.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/buildtool/serve_api/remote/config.hpp') 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 #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 { @@ -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 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 -- cgit v1.2.3