forked from TrueCloudLab/frostfs-node
[#1231] Update new SDK Client interface
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
697c12a5e9
commit
b6720d5f97
14 changed files with 158 additions and 82 deletions
|
@ -65,7 +65,11 @@ func (s *Service) toPrm(req *objectV2.SearchRequest, stream objectSvc.SearchStre
|
|||
return nil, err
|
||||
}
|
||||
|
||||
stream, err := rpc.SearchObjects(c.RawForAddress(addr), req, rpcclient.WithContext(stream.Context()))
|
||||
var searchStream *rpc.SearchResponseReader
|
||||
err = c.RawForAddress(addr, func(cli *rpcclient.Client) error {
|
||||
searchStream, err = rpc.SearchObjects(cli, req, rpcclient.WithContext(stream.Context()))
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -79,7 +83,7 @@ func (s *Service) toPrm(req *objectV2.SearchRequest, stream objectSvc.SearchStre
|
|||
|
||||
for {
|
||||
// receive message from server stream
|
||||
err := stream.Read(resp)
|
||||
err := searchStream.Read(resp)
|
||||
if err != nil {
|
||||
if errors.Is(err, io.EOF) {
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue