From: Aaron Schulz Date: Fri, 24 May 2019 21:01:17 +0000 (-0700) Subject: Cleanup DerivedPageDataUpdater::doSecondaryDataUpdates and remove redundant caller... X-Git-Tag: 1.34.0-rc.0~1597 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=bde1c2e28be596738aaac9d27daf77761caa9590;p=lhc%2Fweb%2Fwiklou.git Cleanup DerivedPageDataUpdater::doSecondaryDataUpdates and remove redundant caller option Change-Id: I8bbc6cd76d035635d47d1158df34c625879a8cc3 --- diff --git a/includes/Storage/DerivedPageDataUpdater.php b/includes/Storage/DerivedPageDataUpdater.php index bc48a0e7bd..ff5541d800 100644 --- a/includes/Storage/DerivedPageDataUpdater.php +++ b/includes/Storage/DerivedPageDataUpdater.php @@ -1582,10 +1582,10 @@ class DerivedPageDataUpdater implements IDBAccessObject { ]; $deferValues = [ false, DeferredUpdates::PRESEND, DeferredUpdates::POSTSEND ]; if ( !in_array( $options['defer'], $deferValues, true ) ) { - throw new InvalidArgumentException( 'invalid value for defer: ' . $options['defer'] ); + throw new InvalidArgumentException( 'Invalid value for defer: ' . $options['defer'] ); } - Assert::parameterType( 'integer|null', $options['transactionTicket'], - '$options[\'transactionTicket\']' ); + Assert::parameterType( + 'integer|null', $options['transactionTicket'], '$options[\'transactionTicket\']' ); $updates = $this->getSecondaryDataUpdates( $options['recursive'] ); @@ -1596,14 +1596,13 @@ class DerivedPageDataUpdater implements IDBAccessObject { $causeAction = $this->options['causeAction'] ?? 'unknown'; $causeAgent = $this->options['causeAgent'] ?? 'unknown'; $legacyRevision = new Revision( $this->revision ); + $ticket = $options['transactionTicket']; - if ( $options['defer'] === false && $options['transactionTicket'] !== null ) { + if ( $options['defer'] === false && $ticket !== null ) { // For legacy hook handlers doing updates via LinksUpdateConstructed, make sure // any pending writes they made get flushed before the doUpdate() calls below. // This avoids snapshot-clearing errors in LinksUpdate::acquirePageLock(). - $this->loadbalancerFactory->commitAndWaitForReplication( - __METHOD__, $options['transactionTicket'] - ); + $this->loadbalancerFactory->commitAndWaitForReplication( __METHOD__, $ticket ); } foreach ( $updates as $update ) { @@ -1616,8 +1615,8 @@ class DerivedPageDataUpdater implements IDBAccessObject { } if ( $options['defer'] === false ) { - if ( $update instanceof DataUpdate && $options['transactionTicket'] !== null ) { - $update->setTransactionTicket( $options['transactionTicket'] ); + if ( $update instanceof DataUpdate && $ticket !== null ) { + $update->setTransactionTicket( $ticket ); } $update->doUpdate(); } else { diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index b1c805b4a4..a0b6e07aef 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -280,8 +280,7 @@ class RefreshLinksJob extends Job { // Carry over cause so the update can do extra logging 'causeAction' => $this->params['causeAction'], 'causeAgent' => $this->params['causeAgent'], - 'defer' => false, - 'transactionTicket' => $ticket, + 'transactionTicket' => $ticket ]; if ( !empty( $this->params['triggeringUser'] ) ) { $userInfo = $this->params['triggeringUser'];