X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJobQueue.php;h=c4ce2ba9b177210a5297200c623910e0c22aab6b;hb=8e7f3526100cb1238dd5cb53f698047ba0c1a644;hp=d20a233ee2ddb7fa203d5fbf57b8b1c69cab969b;hpb=942446575486057b38e186a8f5599a645758b702;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php index d20a233ee2..c4ce2ba9b1 100644 --- a/includes/jobqueue/JobQueue.php +++ b/includes/jobqueue/JobQueue.php @@ -58,8 +58,8 @@ abstract class JobQueue { protected function __construct( array $params ) { $this->wiki = $params['wiki']; $this->type = $params['type']; - $this->claimTTL = isset( $params['claimTTL'] ) ? $params['claimTTL'] : 0; - $this->maxTries = isset( $params['maxTries'] ) ? $params['maxTries'] : 3; + $this->claimTTL = $params['claimTTL'] ?? 0; + $this->maxTries = $params['maxTries'] ?? 3; if ( isset( $params['order'] ) && $params['order'] !== 'any' ) { $this->order = $params['order']; } else { @@ -69,12 +69,8 @@ abstract class JobQueue { throw new MWException( __CLASS__ . " does not support '{$this->order}' order." ); } $this->dupCache = wfGetCache( CACHE_ANYTHING ); - $this->aggr = isset( $params['aggregator'] ) - ? $params['aggregator'] - : new JobQueueAggregatorNull( [] ); - $this->readOnlyReason = isset( $params['readOnlyReason'] ) - ? $params['readOnlyReason'] - : false; + $this->aggr = $params['aggregator'] ?? new JobQueueAggregatorNull( [] ); + $this->readOnlyReason = $params['readOnlyReason'] ?? false; } /** @@ -378,7 +374,7 @@ abstract class JobQueue { // Flag this job as an old duplicate based on its "root" job... try { if ( $job && $this->isRootJobOldDuplicate( $job ) ) { - JobQueue::incrStats( 'dupe_pops', $this->type ); + self::incrStats( 'dupe_pops', $this->type ); $job = DuplicateJob::newFromJob( $job ); // convert to a no-op } } catch ( Exception $e ) { @@ -472,7 +468,7 @@ abstract class JobQueue { $params = $job->getRootJobParams(); $key = $this->getRootJobCacheKey( $params['rootJobSignature'] ); - // Callers should call batchInsert() and then this function so that if the insert + // Callers should call JobQueueGroup::push() before this method so that if the insert // fails, the de-duplication registration will be aborted. Since the insert is // deferred till "transaction idle", do the same here, so that the ordering is // maintained. Having only the de-duplication registration succeed would cause