Skip to content

Commit

Permalink
fix a segfault when passing on requestCrawl fails (#841)
Browse files Browse the repository at this point in the history
my bad! had snuck in that recently, `response` is nil if there is an
error.
  • Loading branch information
bnewbold authored Nov 22, 2024
2 parents aff0005 + 8eb0d80 commit b6f34c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bgs/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ func (s *BGS) handleComAtprotoSyncRequestCrawl(ctx context.Context, body *comatp
pu := rpu.JoinPath("/xrpc/com.atproto.sync.requestCrawl")
response, err := s.httpClient.Post(pu.String(), "application/json", bytes.NewReader(bodyBlob))
if err != nil {
log.Warnw("requestCrawl forward failed", "err", err)
log.Warnw("requestCrawl forward failed", "host", rpu, "err", err)
} else if response.StatusCode != http.StatusOK {
log.Warnw("requestCrawl forward failed", "status", response.Status)
log.Warnw("requestCrawl forward failed", "host", rpu, "status", response.Status)
} else {
log.Infow("requestCrawl forward successful", "host", rpu)
}
log.Infow("requestCrawl forward successful", "host", rpu, "status", response.Status)
}
}(blob)
}
Expand Down

0 comments on commit b6f34c7

Please sign in to comment.