diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-27 12:36:22 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 12:58:35 +0200 |
commit | 0d8a4ad15b93283cc31787b039051b9e9a285ba8 (patch) | |
tree | 40efbd2206659d6836ec0b3beec0811d2a01644f /src/buildtool/execution_api/execution_service/bytestream_server.hpp | |
parent | f82adab238f4b45d43049687c8e52bf7372ba053 (diff) | |
download | justbuild-0d8a4ad15b93283cc31787b039051b9e9a285ba8.tar.gz |
Pass StorageConfig and Storage to ServerImpl
Diffstat (limited to 'src/buildtool/execution_api/execution_service/bytestream_server.hpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/bytestream_server.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buildtool/execution_api/execution_service/bytestream_server.hpp b/src/buildtool/execution_api/execution_service/bytestream_server.hpp index 69a30713..870aed77 100644 --- a/src/buildtool/execution_api/execution_service/bytestream_server.hpp +++ b/src/buildtool/execution_api/execution_service/bytestream_server.hpp @@ -18,10 +18,16 @@ #include "google/bytestream/bytestream.grpc.pb.h" #include "gsl/gsl" #include "src/buildtool/logging/logger.hpp" +#include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" class BytestreamServiceImpl : public ::google::bytestream::ByteStream::Service { public: + explicit BytestreamServiceImpl( + gsl::not_null<StorageConfig const*> const& storage_config, + gsl::not_null<Storage const*> const& storage) noexcept + : storage_config_{*storage_config}, storage_{*storage} {} + // `Read()` is used to retrieve the contents of a resource as a sequence // of bytes. The bytes are returned in a sequence of responses, and the // responses are delivered as the results of a server-side streaming RPC. @@ -76,7 +82,8 @@ class BytestreamServiceImpl : public ::google::bytestream::ByteStream::Service { -> ::grpc::Status override; private: - gsl::not_null<Storage const*> storage_ = &Storage::Instance(); + StorageConfig const& storage_config_; + Storage const& storage_; Logger logger_{"execution-service:bytestream"}; }; |