Check status of response before retry send push (#507)
This commit is contained in:
parent
c8ce081803
commit
20a9d18ce6
|
@ -389,7 +389,11 @@ Retry:
|
||||||
}
|
}
|
||||||
|
|
||||||
StatStorage.AddIosError(1)
|
StatStorage.AddIosError(1)
|
||||||
newTokens = append(newTokens, token)
|
// We should retry only "retryable" statuses. More info about response:
|
||||||
|
// https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/handling_notification_responses_from_apns
|
||||||
|
if res.StatusCode >= http.StatusInternalServerError {
|
||||||
|
newTokens = append(newTokens, token)
|
||||||
|
}
|
||||||
isError = true
|
isError = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,8 +164,13 @@ Retry:
|
||||||
}
|
}
|
||||||
|
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
|
// We should retry only "retryable" statuses. More info about response:
|
||||||
|
// https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream-http-messages-plain-text
|
||||||
|
if !result.Unregistered() {
|
||||||
|
newTokens = append(newTokens, to)
|
||||||
|
}
|
||||||
isError = true
|
isError = true
|
||||||
newTokens = append(newTokens, to)
|
|
||||||
LogPush(FailedPush, to, req, result.Error)
|
LogPush(FailedPush, to, req, result.Error)
|
||||||
if PushConf.Core.Sync {
|
if PushConf.Core.Sync {
|
||||||
req.AddLog(getLogPushEntry(FailedPush, to, req, result.Error))
|
req.AddLog(getLogPushEntry(FailedPush, to, req, result.Error))
|
||||||
|
|
Loading…
Reference in New Issue