mirror of https://github.com/zulip/zulip.git
push_notifications: Handle BrokenPipeError from APNS.
This seems to happen when Apple is having a partial outage on some of their APNS shards; it should be treated like other networking errors connecting to APNS (with an automatic retry).
This commit is contained in:
parent
196ec78261
commit
d723dbfef7
|
@ -143,6 +143,10 @@ def send_apple_push_notification(user_id: int, devices: List[DeviceToken],
|
||||||
logger.warning("APNs: HTTP error sending for user %d to device %s: %s",
|
logger.warning("APNs: HTTP error sending for user %d to device %s: %s",
|
||||||
user_id, device.token, e.__class__.__name__)
|
user_id, device.token, e.__class__.__name__)
|
||||||
return None
|
return None
|
||||||
|
except BrokenPipeError as e:
|
||||||
|
logger.warning("APNs: HTTP BrokenPipeError error sending for user %d to device %s: %s",
|
||||||
|
user_id, device.token, e.__class__.__name__)
|
||||||
|
return None
|
||||||
|
|
||||||
result = attempt_send()
|
result = attempt_send()
|
||||||
while result is None and retries_left > 0:
|
while result is None and retries_left > 0:
|
||||||
|
|
Loading…
Reference in New Issue