diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-25 14:53:18 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-30 12:10:06 +0200 |
commit | 8669d48933731f224474a9b1dc55824f87ae26a7 (patch) | |
tree | 7d097fdf3f89e5fc88899c8e7f4723a4870f3e60 /src/buildtool/execution_api/execution_service/server_implementation.cpp | |
parent | 69f56ad981da59f026c83b321522ad68283934c5 (diff) | |
download | justbuild-8669d48933731f224474a9b1dc55824f87ae26a7.tar.gz |
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.
Diffstat (limited to 'src/buildtool/execution_api/execution_service/server_implementation.cpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/server_implementation.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
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<std::string> interface, return std::move(server); } -auto ServerImpl::Run(StorageConfig const& storage_config, - Storage const& storage, +auto ServerImpl::Run(gsl::not_null<LocalContext const*> const& local_context, 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}; + 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()}; |