X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupUploadStash.php;h=61cd9c24cd4e39cf23ce8bf3eb6b1658e11531a2;hb=c99e9beff7d7c1a5a48f8d6f869a42425021c62b;hp=95bbe3d3ffd8fc4a0f6c40af6fbcc9b9dc7bd7a2;hpb=4cb9c1a24bde6e29c5e8f05c7cd1de54ffdd342a;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupUploadStash.php b/maintenance/cleanupUploadStash.php index 95bbe3d3ff..61cd9c24cd 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 = []; @@ -152,5 +152,5 @@ class UploadStashCleanup extends Maintenance { } } -$maintClass = "UploadStashCleanup"; +$maintClass = UploadStashCleanup::class; require_once RUN_MAINTENANCE_IF_MAIN;