Closed Wakeful-Cloud closed 1 year ago
Thanks for raising this. I'll take a look tonight along with the other open PR.
I'm a little worried this might break some existing retries that are valid, So I'm going to need to take a bit of a deeper look.
@strideynet That was my concern too. I wonder if it's possible to analyze a response header/body to determine if the request actually failed or not. Are you aware of any known cases where Spotify returns 202 even though the request should be retried?
I was planning on addressing this too, then saw this PR. I think given that StatusAccepted was added for a reason, a safer approach might be to instead change the retry checks in c.execute
and c.get
to include a check of the needsStatus:
if c.AutoRetry &&
isFailure(resp.StatusCode, needsStatus) &&
shouldRetry(resp.StatusCode) {
// <retry logic>
}
gah, sorry, just realized I'm necro-ing a year old PR. will open a new PR for this.
Fixes #182
NOTE: I don't know if
http.StatusAccepted
is used by other endpoints in cases where the response needs to be retried.