$conds[] = 'img_timestamp >= ' . $dbw->addQuotes( $dbw->timestamp( $since ) );
}
+ $batchSize = $this->getBatchSize();
$batch = [];
$lastName = '';
do {
[ 'img_name', 'img_sha1' ],
array_merge( [ 'img_name > ' . $dbw->addQuotes( $lastName ) ], $conds ),
__METHOD__,
- [ 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'img_name' ]
+ [ 'LIMIT' => $batchSize, 'ORDER BY' => 'img_name' ]
);
foreach ( $res as $row ) {
'src' => $spath, 'dst' => $dpath, 'img' => $ofile->getArchiveName() ];
}
- if ( count( $batch ) >= $this->mBatchSize ) {
+ if ( count( $batch ) >= $batchSize ) {
$this->runBatch( $batch, $be );
$batch = [];
}
$res = $dbw->select( 'filearchive', [ 'fa_storage_key', 'fa_id', 'fa_name' ],
array_merge( [ 'fa_id > ' . $dbw->addQuotes( $lastId ) ], $conds ),
__METHOD__,
- [ 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'fa_id' ]
+ [ 'LIMIT' => $batchSize, 'ORDER BY' => 'fa_id' ]
);
foreach ( $res as $row ) {
$batch[] = [ 'op' => 'copy', 'src' => $spath, 'dst' => $dpath,
'overwriteSame' => true, 'img' => "(ID {$row->fa_id}) {$row->fa_name}" ];
- if ( count( $batch ) >= $this->mBatchSize ) {
+ if ( count( $batch ) >= $batchSize ) {
$this->runBatch( $batch, $be );
$batch = [];
}