Push: Bail out of notification job early if no subscriptions found

Change-Id: Ica8e5c0496171dba4315c27072c2d865eb747e78
This commit is contained in:
Michael Holloway 2020-06-10 15:14:00 -04:00
parent 153db72ec4
commit 657e914513

View file

@ -15,6 +15,9 @@ class NotificationRequestJob extends Job {
$echoServices = EchoServices::getInstance();
$subscriptionManager = $echoServices->getPushSubscriptionManager();
$subscriptions = $subscriptionManager->getSubscriptionsForUser( $centralId );
if ( count( $subscriptions ) === 0 ) {
return true;
}
$serviceClient = $echoServices->getPushNotificationServiceClient();
$serviceClient->sendCheckEchoRequests( $subscriptions );
return true;