Backport WikiMap/JobQueueGroup logic to handle hyphenated DB names
[lhc/web/wiklou.git] / includes / jobqueue / JobQueue.php
index 9701dd9..3a8bf1a 100644 (file)
@@ -19,7 +19,6 @@
  *
  * @file
  * @defgroup JobQueue JobQueue
- * @author Aaron Schulz
  */
 use MediaWiki\MediaWikiServices;
 
@@ -363,7 +362,7 @@ abstract class JobQueue {
                global $wgJobClasses;
 
                $this->assertNotReadOnly();
-               if ( $this->wiki !== wfWikiID() ) {
+               if ( !WikiMap::isCurrentWikiDbDomain( $this->wiki ) ) {
                        throw new MWException( "Cannot pop '{$this->type}' job off foreign wiki queue." );
                } elseif ( !isset( $wgJobClasses[$this->type] ) ) {
                        // Do not pop jobs if there is no class for the queue type
@@ -379,7 +378,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 ) {