Skip to content

Commit 0fa5e9e

Browse files
author
xinfan.wu(吴歆帆)
committed
fix:maxCallAttempts default values
1 parent bdd707e commit 0fa5e9e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clientconn.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error)
173173
}
174174

175175
if cc.dopts.defaultServiceConfigRawJSON != nil {
176+
if cc.dopts.maxCallAttempts == 0 {
177+
cc.dopts.maxCallAttempts = defaultMaxCallAttempts
178+
}
176179
scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON, cc.dopts.maxCallAttempts)
177180
if scpr.Err != nil {
178181
return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, scpr.Err)

0 commit comments

Comments
 (0)