Skip to content

Commit

Permalink
Address reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ischasny committed Jan 23, 2023
1 parent abf4afa commit 350ede8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions find.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ func (s *server) findMetadataSubtree(w http.ResponseWriter, r *http.Request) {
maxWait: config.Server.ResultMaxWait,
}

var count int32
// TODO: wait for the first successful response instead
// TODO: wait for the first successfull response instead
if err := sg.scatter(ctx, func(cctx context.Context, b *url.URL) (*[]byte, error) {
// Copy the URL from original request and override host/schema to point
// to the server.
Expand Down Expand Up @@ -100,10 +99,8 @@ func (s *server) findMetadataSubtree(w http.ResponseWriter, r *http.Request) {

switch resp.StatusCode {
case http.StatusOK:
atomic.AddInt32(&count, 1)
return &data, nil
case http.StatusNotFound:
atomic.AddInt32(&count, 1)
return nil, nil
default:
return nil, fmt.Errorf("status %d response from backend %s", resp.StatusCode, b.String())
Expand Down
Binary file added indexstar
Binary file not shown.

0 comments on commit 350ede8

Please sign in to comment.