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

Commit

Permalink
bug: Remove discussion comment and useless bool return
Browse files Browse the repository at this point in the history
Closes #1026
  • Loading branch information
jrconlin committed Sep 26, 2017
1 parent 2e07a7d commit 243b7d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions autopush/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def save_channels(self, uaid, channels):

@track_provisioned
def store_message(self, notification):
# type: (WebPushNotification) -> bool
# type: (WebPushNotification) -> None
"""Stores a WebPushNotification in the message table"""
item = dict(
uaid=hasher(notification.uaid.hex),
Expand All @@ -448,7 +448,6 @@ def store_message(self, notification):
updateid=notification.update_id
)
self.table.put_item(data=item, overwrite=True)
return True

@track_provisioned
def delete_message(self, notification):
Expand Down
7 changes: 2 additions & 5 deletions autopush/router/webpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,14 @@ def route_notification(self, notification, uaid_data):
# - Success (older version): Done, return 202
# - Error (db error): Done, return 503
try:
result = yield self._save_notification(uaid_data, notification)
if result is False:
returnValue(self.stored_response(notification))
yield self._save_notification(uaid_data, notification)
except JSONResponseError:
raise RouterException("Error saving to database",
status_code=503,
response_body="Retry Request",
errno=201)

# - Lookup client
# - Lookup client again to get latest node state after save.
# - Success (node found): Notify node of new notification
# - Success: Done, return 200
# - Error (no client): Done, return 202
Expand All @@ -119,7 +117,6 @@ def route_notification(self, notification, uaid_data):
# - Error (db error): Done, return 202
# - Error (no client) : Done, return 404
try:
# is this call redundant? We already get uaid_data passed in
uaid_data = yield deferToThread(router.get_uaid, uaid)
except JSONResponseError:
returnValue(self.stored_response(notification))
Expand Down

0 comments on commit 243b7d3

Please sign in to comment.