array $targetsWithVisitThresholds,
$minimumWatchers = null
) {
+ if ( $targetsWithVisitThresholds === [] ) {
+ // No titles requested => no results returned
+ return [];
+ }
+
$dbr = $this->getConnectionRef( DB_REPLICA );
$conds = $this->getVisitingWatchersCondition( $dbr, $targetsWithVisitThresholds );
$dbw = $this->getConnectionRef( DB_MASTER );
$factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
- $ticket = $factory->getEmptyTransactionTicket( __METHOD__ );
+ $ticket = $factory->getEmptyTransactionTicket( $fname );
$watchersChunks = array_chunk( $watchers, $wgUpdateRowsPerQuery );
foreach ( $watchersChunks as $watchersChunk ) {
);
if ( count( $watchersChunks ) > 1 ) {
$factory->commitAndWaitForReplication(
- __METHOD__, $ticket, [ 'domain' => $dbw->getDomainID() ]
+ $fname, $ticket, [ 'domain' => $dbw->getDomainID() ]
);
}
}