From a5f048e3b2504959994cc9545a70fde01b70d99a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 15 Jul 2024 10:19:16 +0200 Subject: 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. --- .../execution_api/execution_service/server_implementation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/execution_service/server_implementation.cpp') 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 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; -- cgit v1.2.3