mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Push: Bail out of notification job early if no subscriptions found
Change-Id: Ica8e5c0496171dba4315c27072c2d865eb747e78
This commit is contained in:
parent
153db72ec4
commit
657e914513
|
@ -15,6 +15,9 @@ class NotificationRequestJob extends Job {
|
||||||
$echoServices = EchoServices::getInstance();
|
$echoServices = EchoServices::getInstance();
|
||||||
$subscriptionManager = $echoServices->getPushSubscriptionManager();
|
$subscriptionManager = $echoServices->getPushSubscriptionManager();
|
||||||
$subscriptions = $subscriptionManager->getSubscriptionsForUser( $centralId );
|
$subscriptions = $subscriptionManager->getSubscriptionsForUser( $centralId );
|
||||||
|
if ( count( $subscriptions ) === 0 ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
$serviceClient = $echoServices->getPushNotificationServiceClient();
|
$serviceClient = $echoServices->getPushNotificationServiceClient();
|
||||||
$serviceClient->sendCheckEchoRequests( $subscriptions );
|
$serviceClient->sendCheckEchoRequests( $subscriptions );
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue