diff --git a/client/config.go b/client/config.go index 5293f537..49c17806 100644 --- a/client/config.go +++ b/client/config.go @@ -136,13 +136,7 @@ func (c *Config) setIdentifier(identifier string) { // Get parsed grpc dial options, should be called after parse was called. func (c *Config) getDialOption() []grpc.DialOption { - options := c.DialOptions - if c.DialOptions == nil { - // Add default connection options. - options = make([]grpc.DialOption, len(DefaultGrpcOpts)) - copy(options, DefaultGrpcOpts) - } - + var options []grpc.DialOption // Construct dial option. if c.EnableTLSAuth { options = append(options, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))) @@ -150,6 +144,13 @@ func (c *Config) getDialOption() []grpc.DialOption { options = append(options, grpc.WithTransportCredentials(insecure.NewCredentials())) } + if c.DialOptions == nil { + // Add default connection options. + options = append(options, DefaultGrpcOpts...) + } else { + options = append(options, c.DialOptions...) + } + options = append(options, grpc.WithChainUnaryInterceptor(grpc_retry.UnaryClientInterceptor( grpc_retry.WithMax(6),