about summary refs log tree commit diff
path: root/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-09-06T21·34-0400
committerglittershark <grfn@gws.fyi>2020-09-06T21·41+0000
commit8f4d89e429b58a78a3052d03715dd9fc867474d2 (patch)
tree6b3acf61b05a64d881913b90a1525a834931d75b /third_party/nix/src/nix-daemon/nix-daemon-proto.cc
parente2530ceec07bbe53133774f414d5c13bb5729522 (diff)
feat(tvix): Implement EnsurePath RPC handler r/1770
Missed this one

Fixes: b/62
Change-Id: I6f3bbcd3e2a7db5786283761b57466da33a497f7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1936
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'third_party/nix/src/nix-daemon/nix-daemon-proto.cc')
-rw-r--r--third_party/nix/src/nix-daemon/nix-daemon-proto.cc13
1 files changed, 13 insertions, 0 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 ed859f584e39..79ff9cadc2d1 100644
--- a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
+++ b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
@@ -336,6 +336,19 @@ class WorkerServiceImpl final : public WorkerService::Service {
         __FUNCTION__);
   }
 
+  Status EnsurePath(grpc::ServerContext* context,
+                    const nix::proto::StorePath* request,
+                    google::protobuf::Empty*) override {
+    auto path = request->path();
+    ASSERT_INPUT_STORE_PATH(path);
+    return HandleExceptions(
+        [&]() -> Status {
+          store_->ensurePath(path);
+          return Status::OK;
+        },
+        __FUNCTION__);
+  }
+
   Status AddTempRoot(grpc::ServerContext*, const nix::proto::StorePath* request,
                      google::protobuf::Empty*) override {
     auto path = request->path();