Use the feedback connection for getting APNS feedback

(imported from commit d371188e0437606b3ff435ee9c005cee2849f6ae)
This commit is contained in:
Leo Franchi
2014-01-22 13:45:43 -05:00
parent 4b7d061bbf
commit c0fdbf81cf
3 changed files with 5 additions and 1 deletions

View File

@@ -76,7 +76,8 @@ def send_apple_push_notification(user, alert, **extra_data):
# NOTE: This is used by the check_apns_tokens manage.py command. Do not call it otherwise, as the
# feedback() call can take up to 15s
def check_apns_feedback():
apns_client = APNs(connection, tail_timeout=20)
feedback_connection = session.get_connection(settings.APNS_FEEDBACK, cert_file=settings.APNS_CERT_FILE)
apns_client = APNs(feedback_connection, tail_timeout=20)
for token, since in apns_client.feedback():
since_date = timestamp_to_datetime(since)