Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
push_notifications: Don't open unnecessary APNs connections.
Alex Vandivera80840aa4d2d
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.pyindex d427ac95a38..9c0f8628a88 100644--- a/zerver/lib/push_notifications.py+++ b/zerver/lib/push_notifications.py@@ -78,7 +78,7 @@ def get_apns_context() -> Optional[APNsContext]:# which fills the logs; see https://github.com/Fatal1ty/aioapns/issues/15logging.getLogger("aioapns").setLevel(logging.CRITICAL)- if settings.APNS_CERT_FILE is None:+ if settings.APNS_CERT_FILE is None: # nocoveragereturn None# NB if called concurrently, this will make excess connections.@@ -99,7 +99,7 @@ def get_apns_context() -> Optional[APNsContext]:def apns_enabled() -> bool:- return get_apns_context() is not None+ return settings.APNS_CERT_FILE is not Nonedef modernize_apns_payload(data: Dict[str, Any]) -> Dict[str, Any]: