From 8669d48933731f224474a9b1dc55824f87ae26a7 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 25 Jul 2024 14:53:18 +0200 Subject: Use LocalContext in execution and serve services The context is passed by not_null const pointer in order to avoid binding to temporaries, and it or parts of it get stored by const ref where needed. --- .../execution_service/server_implementation.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 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 73734840..11be6309 100644 --- a/src/buildtool/execution_api/execution_service/server_implementation.cpp +++ b/src/buildtool/execution_api/execution_service/server_implementation.cpp @@ -81,15 +81,13 @@ auto ServerImpl::Create(std::optional interface, return std::move(server); } -auto ServerImpl::Run(StorageConfig const& storage_config, - Storage const& storage, +auto ServerImpl::Run(gsl::not_null const& local_context, 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}; + ExecutionServiceImpl es{local_context, &*apis.local, op_exponent}; + ActionCacheServiceImpl ac{local_context}; + CASServiceImpl cas{local_context}; + BytestreamServiceImpl b{local_context}; CapabilitiesServiceImpl cap{}; OperarationsServiceImpl op{&es.GetOpCache()}; -- cgit v1.2.3