Made JobRunner bail if wfReadOnly() is true
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 17 Jan 2015 07:05:02 +0000 (23:05 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 17 Jan 2015 07:05:02 +0000 (23:05 -0800)
Change-Id: I97ef66718bf4033768cd820b42521af31539b3f6

includes/jobqueue/JobRunner.php

index d99bfab..ef0f087 100644 (file)
@@ -76,6 +76,12 @@ class JobRunner {
                        $this->runJobsLog( "Executed $count periodic queue task(s)." );
                }
 
+               // Bail out if in read-only mode
+               if ( wfReadOnly() ) {
+                       $response['reached'] = 'read-only';
+                       return $response;
+               }
+
                // Bail out if there is too much DB lag
                list( , $maxLag ) = wfGetLBFactory()->getMainLB( wfWikiID() )->getMaxLag();
                if ( $maxLag >= 5 ) {