fix(GODT-2800): Ensure 429 does not cause bad event

This commit is contained in:
Leander Beernaert
2023-07-31 13:15:26 +02:00
parent 06639ff6cd
commit f0e2688a8e
2 changed files with 2 additions and 1 deletions

View File

@ -413,7 +413,7 @@ func (s *Service) handleEventError(ctx context.Context, lastEventID string, even
}
// If the error is a server-side issue, return error to retry later.
if apiErr := new(proton.APIError); errors.As(err, &apiErr) && apiErr.Status >= 500 {
if apiErr := new(proton.APIError); errors.As(err, &apiErr) && (apiErr.Status == 429 || apiErr.Status >= 500) {
return subscriberName, fmt.Errorf("failed to handle event due to server error: %w", err)
}