Skip to content

Commit

Permalink
Distinguish between request and drain timeouts (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszSlawski-TomTom authored Dec 7, 2023
1 parent 79feecc commit 9e8424e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ func ReadEvents(ctx context.Context, azureResource string) {
}

func readEndpoint(ctx context.Context, azureResource string) (bool, error) { //nolint:cyclop,funlen
ctx, cancel := context.WithTimeout(ctx, *config.Get().RequestTimeout)
reqCtx, cancel := context.WithTimeout(ctx, *config.Get().RequestTimeout)
defer cancel()

log.Debugf("read %s", *config.Get().Endpoint)

req, err := http.NewRequestWithContext(ctx, http.MethodGet, *config.Get().Endpoint, nil)
req, err := http.NewRequestWithContext(reqCtx, http.MethodGet, *config.Get().Endpoint, nil)
if err != nil {
return false, errors.Wrap(err, "error in http.NewRequestWithContext")
}
Expand Down

0 comments on commit 9e8424e

Please sign in to comment.