feat(3p/nix/nix-daemon): Implement Worker::QueryValidPaths handler
Change-Id: I221dcd2a3fa53ead3ea9ac47830d968bb587c6e5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1233 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi>
This commit is contained in:
		
							parent
							
								
									1933e4f97f
								
							
						
					
					
						commit
						d36ee69061
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
					@ -150,6 +150,23 @@ class WorkerServiceImpl final : public WorkerService::Service {
 | 
				
			||||||
    return Status::OK;
 | 
					    return Status::OK;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Status QueryValidPaths(grpc::ServerContext* context,
 | 
				
			||||||
 | 
					                         const StorePaths* request,
 | 
				
			||||||
 | 
					                         StorePaths* response) override {
 | 
				
			||||||
 | 
					    std::set<Path> paths;
 | 
				
			||||||
 | 
					    for (const auto& path : request->paths()) {
 | 
				
			||||||
 | 
					      paths.insert(path);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    auto res = store_->queryValidPaths(paths);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (const auto& path : res) {
 | 
				
			||||||
 | 
					      response->add_paths(path);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return Status::OK;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Status QueryMissing(grpc::ServerContext* context, const StorePaths* request,
 | 
					  Status QueryMissing(grpc::ServerContext* context, const StorePaths* request,
 | 
				
			||||||
                      nix::proto::QueryMissingResponse* response) override {
 | 
					                      nix::proto::QueryMissingResponse* response) override {
 | 
				
			||||||
    std::set<Path> targets;
 | 
					    std::set<Path> targets;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue