X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupUploadStash.php;h=aeaf1503a723a1de256eee9a7281c79ddc4c0b20;hb=b3e2c773246702ed65e4c447cd1cb12b138c44dc;hp=95bbe3d3ffd8fc4a0f6c40af6fbcc9b9dc7bd7a2;hpb=9964ca1a390c446397dcd466916ffed356cdc3c9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupUploadStash.php b/maintenance/cleanupUploadStash.php index 95bbe3d3ff..aeaf1503a7 100644 --- a/maintenance/cleanupUploadStash.php +++ b/maintenance/cleanupUploadStash.php @@ -103,7 +103,7 @@ class UploadStashCleanup extends Maintenance { foreach ( $iterator as $file ) { if ( wfTimestamp( TS_UNIX, $tempRepo->getFileTimestamp( "$dir/$file" ) ) < $cutoff ) { $batch[] = [ 'op' => 'delete', 'src' => "$dir/$file" ]; - if ( count( $batch ) >= $this->mBatchSize ) { + if ( count( $batch ) >= $this->getBatchSize() ) { $this->doOperations( $tempRepo, $batch ); $i += count( $batch ); $batch = []; @@ -122,14 +122,14 @@ class UploadStashCleanup extends Maintenance { $iterator = $tempRepo->getBackend()->getFileList( [ 'dir' => $dir, 'adviseStat' => 1 ] ); $this->output( "Deleting orphaned temp files...\n" ); if ( strpos( $dir, '/local-temp' ) === false ) { // sanity check - $this->error( "Temp repo is not using the temp container.", 1 ); // die + $this->fatalError( "Temp repo is not using the temp container." ); } $i = 0; $batch = []; // operation batch foreach ( $iterator as $file ) { if ( wfTimestamp( TS_UNIX, $tempRepo->getFileTimestamp( "$dir/$file" ) ) < $cutoff ) { $batch[] = [ 'op' => 'delete', 'src' => "$dir/$file" ]; - if ( count( $batch ) >= $this->mBatchSize ) { + if ( count( $batch ) >= $this->getBatchSize() ) { $this->doOperations( $tempRepo, $batch ); $i += count( $batch ); $batch = [];