build: Update mediawiki/mediawiki-codesniffer to 0.10.1
[lhc/web/wiklou.git] / includes / jobqueue / JobQueue.php
index 020a684..1f4f179 100644 (file)
@@ -19,8 +19,8 @@
  *
  * @file
  * @defgroup JobQueue JobQueue
- * @author Aaron Schulz
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Class to handle enqueueing and running of background jobs
@@ -378,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 ) {
@@ -709,7 +709,7 @@ abstract class JobQueue {
        public static function incrStats( $key, $type, $delta = 1 ) {
                static $stats;
                if ( !$stats ) {
-                       $stats = RequestContext::getMain()->getStats();
+                       $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
                }
                $stats->updateCount( "jobqueue.{$key}.all", $delta );
                $stats->updateCount( "jobqueue.{$key}.{$type}", $delta );