From da97556a35f4df437bfc6b7f50d01d586a46c4f1 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Mon, 16 Oct 2023 16:27:00 +0100 Subject: [PATCH] feat: minor cleanup Signed-off-by: Brian McGee --- pkg/pathinfo/grpc.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/pathinfo/grpc.go b/pkg/pathinfo/grpc.go index 8419ed4..8815449 100644 --- a/pkg/pathinfo/grpc.go +++ b/pkg/pathinfo/grpc.go @@ -113,8 +113,11 @@ func (s *Service) Put(ctx context.Context, pathInfo *tvpb.PathInfo) (*tvpb.PathI return nil, status.Error(codes.Internal, "failed to put path info") } + // we need to maintain an index of outHash => digest for lookup in Get + outputHash := nixbase32.EncodeToString(pathInfo.Narinfo.NarSha256) + err = s.outIdx.Put( - nixbase32.EncodeToString(pathInfo.Narinfo.NarSha256), + outputHash, io.NopCloser(bytes.NewReader(digest[:])), ctx, )