Skip to content

Commit

Permalink
don't store search client
Browse files Browse the repository at this point in the history
  • Loading branch information
aschey committed Aug 16, 2024
1 parent e8b6d6a commit e38f920
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions platune-cli/internal/platune_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,23 +300,22 @@ func (p *PlatuneClient) Search(req *platune.SearchRequest) (*platune.SearchRespo
}
}

searchClient := *p.searchClient
if searchClient == nil {
if *p.searchClient == nil {
return nil, fmt.Errorf("not connected")
}
err := searchClient.Send(req)
err := (*p.searchClient).Send(req)

// Retry if we received an EOF
if err == io.EOF {
p.ResetStreams()
err = searchClient.Send(req)
err = (*p.searchClient).Send(req)
}

if err != nil {
return nil, err
}

return searchClient.Recv()
return (*p.searchClient).Recv()
}

func (p *PlatuneClient) Lookup(
Expand Down

0 comments on commit e38f920

Please sign in to comment.