Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / includes / jobqueue / jobs / ClearWatchlistNotificationsJob.php
index b71580a..054718d 100644 (file)
@@ -33,9 +33,9 @@ use MediaWiki\MediaWikiServices;
  * @ingroup JobQueue
  * @since 1.31
  */
-class ClearWatchlistNotificationsJob extends Job {
-       function __construct( Title $title, array $params ) {
-               parent::__construct( 'clearWatchlistNotifications', $title, $params );
+class ClearWatchlistNotificationsJob extends Job implements GenericParameterJob {
+       function __construct( array $params ) {
+               parent::__construct( 'clearWatchlistNotifications', $params );
 
                static $required = [ 'userId', 'casTime' ];
                $missing = implode( ', ', array_diff( $required, array_keys( $this->params ) ) );
@@ -51,7 +51,7 @@ class ClearWatchlistNotificationsJob extends Job {
                $lbFactory = $services->getDBLoadBalancerFactory();
                $rowsPerQuery = $services->getMainConfig()->get( 'UpdateRowsPerQuery' );
 
-               $dbw = $lbFactory->getMainLB()->getConnection( DB_MASTER );
+               $dbw = $lbFactory->getMainLB()->getConnectionRef( DB_MASTER );
                $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
                $timestamp = $this->params['timestamp'] ?? null;
                if ( $timestamp === null ) {
@@ -96,5 +96,6 @@ class ClearWatchlistNotificationsJob extends Job {
                                $firstBatch = false;
                        }
                } while ( $idsToUpdate );
+               return true;
        }
 }