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-17T01·11-0400
committerglittershark <grfn@gws.fyi>2020-07-17T20·37+0000
commitd18246f8b2633602b8a05320c2b3167fd0ad4a6d (patch)
tree5ae7cd96a89ffd0c474364bae6095f077752d076 /third_party/nix/src
parent1b07e588c8dd8826ef2f3c6b40d31e3cf6ae405e (diff)
feat(3p/nix/nix-daemon): Implement Worker::OptimiseStore handler r/1360
Change-Id: I8b1d84799a608a516d0b4980022a7edd545a1ca1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1235
Tested-by: BuildkiteCI
Reviewed-by: Kane York <rikingcoding@gmail.com>
Diffstat (limited to 'third_party/nix/src')
-rw-r--r--third_party/nix/src/nix-daemon/nix-daemon-proto.cc9
1 files changed, 9 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 7344811eeac4..3740a26b8f85 100644
--- a/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
+++ b/third_party/nix/src/nix-daemon/nix-daemon-proto.cc
@@ -1,4 +1,6 @@
+#include <google/protobuf/empty.pb.h>
 #include <google/protobuf/util/time_util.h>
+#include <grpcpp/impl/codegen/server_context.h>
 #include <grpcpp/impl/codegen/status.h>
 #include <grpcpp/impl/codegen/status_code_enum.h>
 
@@ -184,6 +186,13 @@ class WorkerServiceImpl final : public WorkerService::Service {
     return Status::OK;
   }
 
+  Status OptimiseStore(grpc::ServerContext* context,
+                       const google::protobuf::Empty* request,
+                       google::protobuf::Empty* response) override {
+    store_->optimiseStore();
+    return Status::OK;
+  }
+
   Status QueryMissing(grpc::ServerContext* context, const StorePaths* request,
                       nix::proto::QueryMissingResponse* response) override {
     std::set<Path> targets;