Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jrconlin committed Feb 16, 2018
1 parent 3163e2e commit ca5f727
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion autopush/router/apns2.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def send(self, router_token, payload, apns_id,
log_exception=False
)
break
except HTTP20Error:
except (HTTP20Error, IOError):
connection.close()
attempt += 1
if attempt < self._max_retry:
Expand Down
11 changes: 7 additions & 4 deletions autopush/tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,16 @@ def test_message_storage(self):
message.register_channel(self.uaid, chid)
message.register_channel(self.uaid, chid2)

message.store_message(make_webpush_notification(self.uaid, chid))
message.store_message(make_webpush_notification(self.uaid, chid))
message.store_message(make_webpush_notification(self.uaid, chid))
# Ensure that sort keys are fetched from DB in order.
notifs = [make_webpush_notification(self.uaid, chid) for x in range(3)]
keys = [notif.sort_key for notif in notifs]
for msg in notifs:
message.store_message(msg)

_, all_messages = message.fetch_timestamp_messages(
uuid.UUID(self.uaid), " ")
assert len(all_messages) == 3
assert len(all_messages) == len(notifs)
assert keys == [msg.sort_key for msg in all_messages]

def test_message_storage_overwrite(self):
"""Test that store_message can overwrite existing messages which
Expand Down

0 comments on commit ca5f727

Please sign in to comment.