mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
fix(microservices): fix get service from multi package grpc client error
Calling getService of grpc clients with multiple packages shows error 'Channel third argument (options) must be an object with string keys and integer or string values'. Which is caused by passing options with GrpcOptions['options'] format to grpc client's constructor. As the options are transformed and kept in 'maxMessageLengthOptions' and 'keepaliveOptions', we can remove and skip passing ClientGrpcProxy's options to node grpc Client's constructor.
This commit is contained in:
@@ -89,16 +89,10 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
|
||||
}
|
||||
|
||||
const keepaliveOptions = this.getKeepaliveOptions();
|
||||
const options: Record<string, unknown> = isObject(this.options)
|
||||
? {
|
||||
...this.options,
|
||||
...maxMessageLengthOptions,
|
||||
...keepaliveOptions,
|
||||
loader: '',
|
||||
}
|
||||
: {
|
||||
...maxMessageLengthOptions,
|
||||
};
|
||||
const options: Record<string, string | number> = {
|
||||
...maxMessageLengthOptions,
|
||||
...keepaliveOptions,
|
||||
};
|
||||
|
||||
const credentials =
|
||||
options.credentials || grpcPackage.credentials.createInsecure();
|
||||
|
||||
Reference in New Issue
Block a user