Skip to content

Commit d25b114

Browse files
committed
client为空时设置默认值
1 parent b7e42cd commit d25b114

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: addresspool/pool.go

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ func NewPool(addresses []string, opts ...Options) *Pool {
6969

7070
if len(opts) > 0 && opts[0].HttpProbeOptions != nil {
7171
p.httpProbeOptions = opts[0].HttpProbeOptions
72+
if p.httpProbeOptions.Client == nil {
73+
openlog.Info(fmt.Sprintf("http client nil, make one with default options"))
74+
p.httpProbeOptions.Client, _ = httpclient.New(nil)
75+
}
7276
}
7377
p.monitor()
7478
return p

0 commit comments

Comments
 (0)