From d1b351491083d8b9c89a4670614581ff72b5a430 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Thu, 16 Jul 2020 19:45:02 -0400 Subject: feat(3p/nix/nix-daemon): Implement Worker::QueryAllValidPaths handler Change-Id: If9d2144ae872183abf47d84c94cc5c5fa23ced87 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1229 Tested-by: BuildkiteCI Reviewed-by: tazjin --- third_party/nix/src/nix-daemon/nix-daemon-proto.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'third_party') diff --git a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc index 85adb98e9a..33bff43760 100644 --- a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc +++ b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc @@ -48,7 +48,8 @@ class WorkerServiceImpl final : public Worker::Service { } Status QueryValidDerivers(grpc::ServerContext* context, - const StorePath* request, StorePaths* response) { + const StorePath* request, + StorePaths* response) override { const auto& path = request->path(); store_->assertStorePath(path); @@ -76,6 +77,17 @@ class WorkerServiceImpl final : public Worker::Service { return Status::OK; } + Status QueryAllValidPaths(grpc::ServerContext* context, + const google::protobuf::Empty* request, + StorePaths* response) override { + const auto paths = store_->queryAllValidPaths(); + for (const auto& path : paths) { + response->add_paths(path); + } + + return Status::OK; + } + Status QueryMissing(grpc::ServerContext* context, const StorePaths* request, nix::proto::QueryMissingResponse* response) override { std::set targets; -- cgit 1.4.1