49 public function run() {
50 $services = MediaWikiServices::getInstance();
51 $lbFactory = $services->getDBLoadBalancerFactory();
52 $rowsPerQuery = $services->getMainConfig()->get(
'UpdateRowsPerQuery' );
54 $dbw = $lbFactory->getMainLB()->getConnectionRef(
DB_MASTER );
55 $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
56 $timestamp = $this->params[
'timestamp'] ??
null;
57 if ( $timestamp ===
null ) {
58 $timestampCond =
'wl_notificationtimestamp IS NOT NULL';
60 $timestamp = $dbw->timestamp( $timestamp );
61 $timestampCond =
'wl_notificationtimestamp != ' . $dbw->addQuotes( $timestamp ) .
62 ' OR wl_notificationtimestamp IS NULL';
65 $casTimeCond =
'wl_notificationtimestamp < ' .
66 $dbw->addQuotes( $dbw->timestamp( $this->params[
'casTime'] ) ) .
67 ' OR wl_notificationtimestamp IS NULL';
71 $idsToUpdate = $dbw->selectFieldValues(
75 'wl_user' => $this->params[
'userId'],
80 [
'LIMIT' => $rowsPerQuery ]
85 [
'wl_notificationtimestamp' => $timestamp ],
87 'wl_id' => $idsToUpdate,
94 $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
98 }
while ( $idsToUpdate );