Skip to content

Commit

Permalink
remove some logs
Browse files Browse the repository at this point in the history
Signed-off-by: jnathangreeg <[email protected]>
  • Loading branch information
jnathangreeg committed Oct 10, 2024
1 parent ff2021a commit a7d9f9b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions httputils/httphelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ func HttpPostWithContext(ctx context.Context, httpClient IHttpClient, fullURL st
operation := func() error {
req, err := http.NewRequestWithContext(ctx, "POST", fullURL, bytes.NewReader(body))
if err != nil {
fmt.Print("Error creating request")
return backoff.Permanent(err)
}
setHeaders(req, headers)

resp, err = httpClient.Do(req)
if err != nil {
return fmt.Errorf("error making request: %w", err)
fmt.Print("Error sending request")
return err
}
defer resp.Body.Close()

Expand All @@ -103,6 +105,7 @@ func HttpPostWithContext(ctx context.Context, httpClient IHttpClient, fullURL st
}
return backoff.Permanent(err)
}

return nil
}

Expand All @@ -112,10 +115,10 @@ func HttpPostWithContext(ctx context.Context, httpClient IHttpClient, fullURL st

// Run the operation with the exponential backoff policy
if err = backoff.Retry(operation, expBackOff); err != nil {
fmt.Println("error retrying request line 115")
fmt.Print("Error sending request 2")
return resp, err
}
fmt.Println("request successful", "line 118")
fmt.Print("Success sending request")
return resp, nil
}
func defaultShouldRetry(resp *http.Response) bool {
Expand Down

0 comments on commit a7d9f9b

Please sign in to comment.