Assorted minor live patches to command-line scripts.
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 30 Apr 2009 05:52:25 +0000 (05:52 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 30 Apr 2009 05:52:25 +0000 (05:52 +0000)
includes/ForkController.php
maintenance/gearman/gearman.inc
maintenance/namespaceDupes.php
maintenance/storage/trackBlobs.php

index 09e1788..6a38699 100644 (file)
@@ -80,9 +80,11 @@ class ForkController {
                                        } elseif ( pcntl_wifexited( $status ) ) {
                                                // Restart on non-zero exit status
                                                $exitStatus = pcntl_wexitstatus( $status );
-                                               if ( $exitStatus > 0 ) {
+                                               if ( $exitStatus != 0 ) {
                                                        echo "Worker exited with status $exitStatus, restarting\n";
                                                        $this->procsToStart++;
+                                               } else {
+                                                       echo "Worker exited normally\n";
                                                }
                                        }
                                }
index a2a4018..514b9ba 100644 (file)
@@ -12,7 +12,7 @@ class MWGearmanJob extends Net_Gearman_Job_Common {
                socket_close( $this->conn );
 
                # Close some more sockets
-               wfGetLBFactory()->shutdown();
+               LBFactory::destroyInstance();
                global $wgMemc;
                $wgMemc->disconnect_all();
 
index 58615b6..11623f4 100644 (file)
@@ -37,7 +37,7 @@ usage: namespaceDupes.php [--fix] [--suffix=<text>] [--help]
     --prefix=<text> : Do an explicit check for the given title prefix
                       in place of the standard namespace list.
     --verbose       : Display output for checked namespaces without conflicts
-
+    --wiki=<wiki>   : enter the wiki database to edit
 ENDS;
 die;
 }
index fbcc5bc..8ac9474 100644 (file)
@@ -12,6 +12,7 @@ if ( count( $args ) < 1 ) {
 }
 $tracker = new TrackBlobs( $args );
 $tracker->run();
+echo "All done.\n";
 
 class TrackBlobs {
        var $clusters, $textClause;
@@ -263,6 +264,10 @@ class TrackBlobs {
                        if ( is_null( $table ) ) {
                                $table = 'blobs';
                        }
+                       if ( !$extDB->tableExists( $table ) ) {
+                               echo "No blobs table on cluster $cluster\n";
+                               continue;
+                       }
                        $startId = 0;
                        $batchesDone = 0;
                        $actualBlobs = gmp_init( 0 );