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. --- src/buildtool/execution_api/execution_service/ac_server.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/execution_service/ac_server.hpp') diff --git a/src/buildtool/execution_api/execution_service/ac_server.hpp b/src/buildtool/execution_api/execution_service/ac_server.hpp index 3072c70a..59b8297f 100644 --- a/src/buildtool/execution_api/execution_service/ac_server.hpp +++ b/src/buildtool/execution_api/execution_service/ac_server.hpp @@ -18,6 +18,7 @@ #include "build/bazel/remote/execution/v2/remote_execution.grpc.pb.h" #include "gsl/gsl" #include "src/buildtool/common/bazel_types.hpp" +#include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" @@ -25,9 +26,9 @@ class ActionCacheServiceImpl final : public bazel_re::ActionCache::Service { public: explicit ActionCacheServiceImpl( - gsl::not_null const& storage_config, - gsl::not_null const& storage) noexcept - : storage_config_{*storage_config}, storage_{*storage} {} + gsl::not_null const& local_context) noexcept + : storage_config_{*local_context->storage_config}, + storage_{*local_context->storage} {} // Retrieve a cached execution result. // -- cgit v1.2.3