Skip to content

Commit

Permalink
[chore] Remove internal helper, no need to have it
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Oct 15, 2024
1 parent 46b0c2b commit ff13ffe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 3 additions & 1 deletion exporter/exporterhelper/internal/retry_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ func (rs *retrySender) Send(ctx context.Context, req internal.Request) error {
return fmt.Errorf("not retryable error: %w", err)
}

req = internal.ExtractPartialRequest(req, err)
if errReq, ok := req.(internal.RequestErrorHandler); ok {
req = errReq.OnError(err)
}

backoffDelay := expBackoff.NextBackOff()
if backoffDelay == backoff.Stop {
Expand Down
9 changes: 0 additions & 9 deletions exporter/internal/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,3 @@ type RequestErrorHandler interface {
// Otherwise, it should return the original Request.
OnError(error) Request
}

// extractPartialRequest returns a new Request that may contain the items left to be sent
// if only some items failed to process and can be retried. Otherwise, it returns the original Request.
func ExtractPartialRequest(req Request, err error) Request {
if errReq, ok := req.(RequestErrorHandler); ok {
return errReq.OnError(err)
}
return req
}

0 comments on commit ff13ffe

Please sign in to comment.