X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=maintenance%2FcopyJobQueue.php;h=42c2dd4d7703819ab8e4192ab26bc47a672dd97a;hb=8aa6c9f43e9b54e4157a5feee42229a9a48b1764;hp=e833115ba9422d30dbdedc33d52fd16ee6c897c6;hpb=a492cf4c3498edbea090c5eccc2515b4d4a1724b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/copyJobQueue.php b/maintenance/copyJobQueue.php index e833115ba9..42c2dd4d77 100644 --- a/maintenance/copyJobQueue.php +++ b/maintenance/copyJobQueue.php @@ -34,7 +34,7 @@ require_once __DIR__ . '/Maintenance.php'; class CopyJobQueue extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Copy jobs from one queue system to another."; + $this->addDescription( 'Copy jobs from one queue system to another.' ); $this->addOption( 'src', 'Key to $wgJobQueueMigrationConfig for source', true, true ); $this->addOption( 'dst', 'Key to $wgJobQueueMigrationConfig for destination', true, true ); $this->addOption( 'type', 'Types of jobs to copy (use "all" for all)', true, true ); @@ -78,19 +78,18 @@ class CopyJobQueue extends Maintenance { ++$total; $batch[] = $job; if ( count( $batch ) >= $this->mBatchSize ) { - if ( $dst->push( $batch ) ) { - $totalOK += count( $batch ); - } + $dst->push( $batch ); + $totalOK += count( $batch ); $batch = array(); $dst->waitForBackups(); } } if ( count( $batch ) ) { - if ( $dst->push( $batch ) ) { - $totalOK += count( $batch ); - } + $dst->push( $batch ); + $totalOK += count( $batch ); $dst->waitForBackups(); } + return array( $total, $totalOK ); } }