store/service: use client passed in Init options (#1843)

This commit is contained in:
ben-toogood 2020-07-15 14:01:33 +01:00 committed by GitHub
parent 0c19a87c89
commit 68927e875b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,11 @@ func (s *serviceStore) Init(opts ...store.Option) error {
s.Table = s.options.Table
s.Nodes = s.options.Nodes
if s.options.Client == nil {
s.options.Client = client.DefaultClient
}
s.Client = pb.NewStoreService("go.micro.store", s.options.Client)
return nil
}