Skip to content

Commit

Permalink
fix sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Aug 1, 2024
1 parent 03cc388 commit 64b4844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hammer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (w httpLeafWriter) Write(ctx context.Context, newLeaf []byte) (uint64, erro
// Continue below
case http.StatusServiceUnavailable, http.StatusBadGateway, http.StatusGatewayTimeout:
// These status codes may indicate a delay before retrying, so handle that here:
retryDelay(resp.Header.Get("RetryAfter"), time.Second)
time.Sleep(retryDelay(resp.Header.Get("RetryAfter"), time.Second))

return 0, fmt.Errorf("log not available. Status code: %d. Body: %q %w", resp.StatusCode, body, ErrRetry)
default:
Expand Down

0 comments on commit 64b4844

Please sign in to comment.