Skip to content

Commit

Permalink
address feedback from team
Browse files Browse the repository at this point in the history
  • Loading branch information
rogchap committed Oct 21, 2020
1 parent f7482b5 commit 4c83ec6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions js/modules/k6/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ var (
errConnectInInitContext = common.NewInitContextError("connecting to a gRPC server in the init context is not supported")
)

// Client reprecents a gRPC client that can be used to make RPC requests
// Client represents a gRPC client that can be used to make RPC requests
type Client struct {
mds map[string]protoreflect.MethodDescriptor
conn *grpc.ClientConn
}

// NewClient creates a new gPRC client to make invoke RPC methods.
// NewClient creates a new gPRC client to invoke RPC methods.
func (*GRPC) NewClient(ctxPtr *context.Context) interface{} {
rt := common.GetRuntime(*ctxPtr)

Expand All @@ -78,10 +78,10 @@ func (*GRPC) NewClient(ctxPtr *context.Context) interface{} {

// MethodInfo holds information on any parsed method descriptors that can be used by the goja VM
type MethodInfo struct {
grpc.MethodInfo
Package string
Service string
FullMethod string
grpc.MethodInfo `json:"-" js:"-"`
Package string
Service string
FullMethod string
}

// Response is a gRPC response that can be used by the goja VM
Expand Down Expand Up @@ -210,9 +210,9 @@ func (c *Client) Connect(ctxPtr *context.Context, addr string, params map[string
return false, fmt.Errorf("unable to parse %q: %v", k, err)
}
case int64:
timeout = time.Duration(float64(t)) * time.Millisecond
case float64:
timeout = time.Duration(t) * time.Millisecond
case float64:
timeout = time.Duration(t * float64(time.Millisecond))
default:
return false, fmt.Errorf("unable to use type %T as a timeout value", v)
}
Expand Down Expand Up @@ -349,9 +349,9 @@ func (c *Client) Invoke(ctxPtr *context.Context,
return nil, fmt.Errorf("unable to parse %q: %v", k, err)
}
case int64:
timeout = time.Duration(float64(t)) * time.Millisecond
case float64:
timeout = time.Duration(t) * time.Millisecond
case float64:
timeout = time.Duration(t * float64(time.Millisecond))
default:
return nil, fmt.Errorf("unable to use type %T as a timeout value", v)
}
Expand Down

0 comments on commit 4c83ec6

Please sign in to comment.