Disable job throttling for DuplicateJob jobs
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 28 Apr 2014 23:09:35 +0000 (16:09 -0700)
committerOri.livneh <ori@wikimedia.org>
Mon, 28 Apr 2014 23:18:25 +0000 (23:18 +0000)
Change-Id: I461ea9710660d061ae2da1f99f39247877332ca2

maintenance/runJobs.php

index b488fe9..f69a3a3 100644 (file)
@@ -176,9 +176,12 @@ class RunJobs extends Maintenance {
        private function getBackoffTimeToWait( Job $job ) {
                global $wgJobBackoffThrottling;
 
-               if ( !isset( $wgJobBackoffThrottling[$job->getType()] ) ) {
+               if ( !isset( $wgJobBackoffThrottling[$job->getType()] ) ||
+                       $job instanceof DuplicateJob // no work was done
+               ) {
                        return 0; // not throttled
                }
+
                $itemsPerSecond = $wgJobBackoffThrottling[$job->getType()];
                if ( $itemsPerSecond <= 0 ) {
                        return 0; // not throttled