HTTPS-ify links to Wikimedia's sites in MW core source
[lhc/web/wiklou.git] / includes / jobqueue / JobQueue.php
index 1a68489..1cf1b4b 100644 (file)
@@ -323,6 +323,12 @@ abstract class JobQueue {
 
                $this->doBatchPush( $jobs, $flags );
                $this->aggr->notifyQueueNonEmpty( $this->wiki, $this->type );
+
+               foreach ( $jobs as $job ) {
+                       if ( $job->isRootJob() ) {
+                               $this->deduplicateRootJob( $job );
+                       }
+               }
        }
 
        /**
@@ -677,8 +683,12 @@ abstract class JobQueue {
         * @since 1.22
         */
        public static function incrStats( $key, $type, $delta = 1 ) {
-               wfIncrStats( $key, $delta );
-               wfIncrStats( "{$key}-{$type}", $delta );
+               static $stats;
+               if ( !$stats ) {
+                       $stats = RequestContext::getMain()->getStats();
+               }
+               $stats->updateCount( "jobqueue.{$key}", $delta );
+               $stats->updateCount( "jobqueue.{$key}.{$type}", $delta );
        }
 
        /**