mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 00:36:14 -06:00
Restore treating all 5xx codes as temporary problems
This commit is contained in:
parent
4f39da77bb
commit
b982944e85
1 changed files with 2 additions and 2 deletions
|
|
@ -208,7 +208,7 @@ func (r *realSender) sendToSubscription(
|
||||||
case resp.StatusCode == http.StatusRequestTimeout ||
|
case resp.StatusCode == http.StatusRequestTimeout ||
|
||||||
resp.StatusCode == http.StatusRequestEntityTooLarge ||
|
resp.StatusCode == http.StatusRequestEntityTooLarge ||
|
||||||
resp.StatusCode == http.StatusTooManyRequests ||
|
resp.StatusCode == http.StatusTooManyRequests ||
|
||||||
resp.StatusCode == http.StatusServiceUnavailable:
|
(resp.StatusCode >= 500 && resp.StatusCode <= 599):
|
||||||
|
|
||||||
// Try to get the response body.
|
// Try to get the response body.
|
||||||
bodyBytes, err := io.ReadAll(io.LimitReader(resp.Body, responseBodyMaxLen))
|
bodyBytes, err := io.ReadAll(io.LimitReader(resp.Body, responseBodyMaxLen))
|
||||||
|
|
@ -223,7 +223,7 @@ func (r *realSender) sendToSubscription(
|
||||||
string(bodyBytes),
|
string(bodyBytes),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Some serious error that indicates auth problems.
|
// Some serious error that indicates auth problems, not a Web Push server, etc.
|
||||||
// We should not send any more notifications to this subscription. Try to delete it.
|
// We should not send any more notifications to this subscription. Try to delete it.
|
||||||
default:
|
default:
|
||||||
err := r.state.DB.DeleteWebPushSubscriptionByTokenID(ctx, subscription.TokenID)
|
err := r.state.DB.DeleteWebPushSubscriptionByTokenID(ctx, subscription.TokenID)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue