Followup r87225
[lhc/web/wiklou.git] / maintenance / fixSlaveDesync.php
index 0d91f54..fe89294 100644 (file)
@@ -24,9 +24,12 @@ class FixSlaveDesync extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "";
-               
        }
-       
+
+       public function getDbType() {
+               return Maintenance::DB_ADMIN;
+       }
+
        public function execute() {
                $this->slaveIndexes = array();
                for ( $i = 1; $i < wfGetLB()->getServerCount(); $i++ ) {
@@ -38,8 +41,6 @@ class FixSlaveDesync extends Maintenance {
                if ( $this->hasArg() ) {
                        $this->desyncFixPage( $this->getArg() );
                } else {
-                       $dbw = wfGetDB( DB_MASTER );
-                       $maxPage = $dbw->selectField( 'page', 'MAX(page_id)', false, __METHOD__ );
                        $corrupt = $this->findPageLatestCorruption();
                        foreach ( $corrupt as $id => $dummy ) {
                                $this->desyncFixPage( $id );
@@ -203,4 +204,4 @@ class FixSlaveDesync extends Maintenance {
 }
 
 $maintClass = "FixSlaveDesync";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );