Do not bother with ForkController for procs=1.
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Apr 2013 21:23:05 +0000 (14:23 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Apr 2013 21:23:10 +0000 (14:23 -0700)
Change-Id: I84d4dd5369c5640b849d2fb58e01b8565b2abd65

maintenance/runJobs.php

index 66d8028..ef80df5 100644 (file)
@@ -61,10 +61,11 @@ class RunJobs extends Maintenance {
                        $procs = intval( $this->getOption( 'procs' ) );
                        if ( $procs < 1 || $procs > 1000 ) {
                                $this->error( "Invalid argument to --procs", true );
-                       }
-                       $fc = new ForkController( $procs );
-                       if ( $fc->start() != 'child' ) {
-                               exit( 0 );
+                       } elseif ( $procs != 1 ) {
+                               $fc = new ForkController( $procs );
+                               if ( $fc->start() != 'child' ) {
+                                       exit( 0 );
+                               }
                        }
                }
                $maxJobs = $this->getOption( 'maxjobs', false );