Skip to content

Commit

Permalink
Log on keys return
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlogic committed Sep 4, 2023
1 parent 1e49640 commit 34cc737
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (s *Server) Write(ctx context.Context, req *pb.WriteRequest) (*pb.WriteResp
func (s *Server) GetKeys(ctx context.Context, req *pb.GetKeysRequest) (*pb.GetKeysResponse, error) {
keys, err := s.rdb.Keys(ctx, fmt.Sprintf("%v*", req.GetPrefix())).Result()
if err != nil {
return nil, err
return nil, fmt.Errorf("database error reading keys %w", err)
}

var akeys []string
Expand All @@ -74,6 +74,7 @@ func (s *Server) GetKeys(ctx context.Context, req *pb.GetKeysRequest) (*pb.GetKe
}
}

log.Printf("Returning %v items", len(akeys))
return &pb.GetKeysResponse{Keys: akeys}, nil
}

Expand Down

0 comments on commit 34cc737

Please sign in to comment.