Treat a null result of Job::run() like "true".
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 13 Feb 2013 18:56:22 +0000 (10:56 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 13 Feb 2013 18:58:18 +0000 (10:58 -0800)
Change-Id: Ie5b725b9d8aad9d6b1869242e82b13306b61478f

maintenance/runJobs.php

index 3fc9288..f64b5e8 100644 (file)
@@ -90,15 +90,16 @@ class RunJobs extends Maintenance {
                                // Perform the job (logging success/failure and runtime)...
                                $t = microtime( true );
                                $this->runJobsLog( $job->toString() . " STARTING" );
-                               $status = $job->run();
 
-                               if( !is_bool( $status ) ) {
-                                       wfWarn( $job->toString() . ' must return boolean and didn\'t!'  );
+                               $status = $job->run();
+                               if ( !is_bool( $status ) ) {
+                                       wfWarn( $job->getType() . " job failed to return a boolean." );
+                                       $status = true; // sanity
                                }
-
                                if ( $status ) {
                                        $group->ack( $job ); // done
                                }
+
                                $t = microtime( true ) - $t;
                                $timeMs = intval( $t * 1000 );
                                if ( !$status ) {