Skip to content

Commit

Permalink
Fix grpc any.proto marshal error
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowersea committed May 9, 2022
1 parent 973a12d commit 7f823f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/modules/k6/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,12 @@ func (c *Client) convertToMethodInfo(fdset *descriptorpb.FileDescriptorSet) ([]M
messages := fd.Messages()
for i := 0; i < messages.Len(); i++ {
message := messages.Get(i)
err = protoregistry.GlobalTypes.RegisterMessage(dynamicpb.NewMessageType(message))
if err != nil {
return false
_, errFind := protoregistry.GlobalTypes.FindMessageByName(message.FullName())
if errFind == protoregistry.NotFound {
err = protoregistry.GlobalTypes.RegisterMessage(dynamicpb.NewMessageType(message))
if err != nil {
return false
}
}
}
return true
Expand Down

0 comments on commit 7f823f0

Please sign in to comment.