50 public function run() {
51 $services = MediaWikiServices::getInstance();
52 $lbFactory = $services->getDBLoadBalancerFactory();
53 $rowsPerQuery = $services->getMainConfig()->get( MainConfigNames::UpdateRowsPerQuery );
55 $dbw = $lbFactory->getMainLB()->getConnectionRef(
DB_PRIMARY );
56 $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
57 $timestamp = $this->params[
'timestamp'] ??
null;
58 if ( $timestamp ===
null ) {
59 $timestampCond =
'wl_notificationtimestamp IS NOT NULL';
61 $timestamp = $dbw->timestamp( $timestamp );
62 $timestampCond =
'wl_notificationtimestamp != ' . $dbw->addQuotes( $timestamp ) .
63 ' OR wl_notificationtimestamp IS NULL';
66 $casTimeCond =
'wl_notificationtimestamp < ' .
67 $dbw->addQuotes( $dbw->timestamp( $this->params[
'casTime'] ) ) .
68 ' OR wl_notificationtimestamp IS NULL';
72 $idsToUpdate = $dbw->selectFieldValues(
76 'wl_user' => $this->params[
'userId'],
81 [
'LIMIT' => $rowsPerQuery ]
86 [
'wl_notificationtimestamp' => $timestamp ],
88 'wl_id' => $idsToUpdate,
95 $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
99 }
while ( $idsToUpdate );