summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/execution_service/server_implementation.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-15 10:19:16 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-19 09:50:37 +0200
commita5f048e3b2504959994cc9545a70fde01b70d99a (patch)
tree42ef3e92abdba766e4c56ed8e0dbfff37de22416 /src/buildtool/execution_api/execution_service/server_implementation.cpp
parent1acde5fa1f37b8e4856f96aba092a38faaac737f (diff)
downloadjustbuild-a5f048e3b2504959994cc9545a70fde01b70d99a.tar.gz
Make OperationCache a general class, not singleton
As it is used by just execute only, instantiate it inside the ExecutionServer, which reads and writes to the cache map, and pass a const ref to OperationsServer, which only queries.
Diffstat (limited to 'src/buildtool/execution_api/execution_service/server_implementation.cpp')
-rw-r--r--src/buildtool/execution_api/execution_service/server_implementation.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/execution_service/server_implementation.cpp b/src/buildtool/execution_api/execution_service/server_implementation.cpp
index 42cb6242..63322451 100644
--- a/src/buildtool/execution_api/execution_service/server_implementation.cpp
+++ b/src/buildtool/execution_api/execution_service/server_implementation.cpp
@@ -55,13 +55,15 @@ auto TryWrite(std::string const& file, T const& content) noexcept -> bool {
auto ServerImpl::Run(StorageConfig const& storage_config,
Storage const& storage,
- ApiBundle const& apis) -> bool {
- ExecutionServiceImpl es{&storage_config, &storage, &*apis.local};
+ ApiBundle const& apis,
+ std::optional<std::uint8_t> op_exponent) -> bool {
+ ExecutionServiceImpl es{
+ &storage_config, &storage, &*apis.local, op_exponent};
ActionCacheServiceImpl ac{&storage_config, &storage};
CASServiceImpl cas{&storage_config, &storage};
BytestreamServiceImpl b{&storage_config, &storage};
CapabilitiesServiceImpl cap{};
- OperarationsServiceImpl op{};
+ OperarationsServiceImpl op{&es.GetOpCache()};
grpc::ServerBuilder builder;