mirror of https://github.com/zulip/zulip.git
Add a check_apns_tokens manage.py command to flush old tokens
(imported from commit 15dcfaa1967bd749b582882c4a816a457ca6cc12)
This commit is contained in:
parent
410ee44eb6
commit
dc8bfde0b4
|
@ -0,0 +1,18 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.conf import settings
|
||||
|
||||
from zerver.models import AppleDeviceToken
|
||||
|
||||
from zerver.lib.push_notifications import check_apns_feedback
|
||||
import logging
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = """Checks the Apple Push Notifications Service for any tokens that have been
|
||||
invalidated, and removes them from the database.
|
||||
|
||||
Usage: ./manage.py check_apns_tokens"""
|
||||
|
||||
def handle(self, *args, **options):
|
||||
check_apns_feedback()
|
Loading…
Reference in New Issue