about summary refs log tree commit diff
path: root/third_party/nix/src
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-16T23·45-0400
committerglittershark <grfn@gws.fyi>2020-07-16T23·57+0000
commitd1b351491083d8b9c89a4670614581ff72b5a430 (patch)
tree2f489c99731589b8ac578cf2dfc4ba5975188f99 /third_party/nix/src
parentec859afe9577cafa074cd15a0cfb41ae51c419b5 (diff)
feat(3p/nix/nix-daemon): Implement Worker::QueryAllValidPaths handler r/1342
Change-Id: If9d2144ae872183abf47d84c94cc5c5fa23ced87
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1229
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/nix/src')
-rw-r--r--third_party/nix/src/nix-daemon/nix-daemon-proto.cc14
1 files changed, 13 insertions, 1 deletions
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 85adb98e9abb..33bff437600d 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<Path> targets;