Update for Phan 0.10.1
[lhc/web/wiklou.git] / maintenance / cleanupUploadStash.php
index cd7a842..14c6a6b 100644 (file)
@@ -47,7 +47,7 @@ class UploadStashCleanup extends Maintenance {
                $repo = RepoGroup::singleton()->getLocalRepo();
                $tempRepo = $repo->getTempRepo();
 
-               $dbr = $repo->getSlaveDB();
+               $dbr = $repo->getReplicaDB();
 
                // how far back should this look for files to delete?
                $cutoff = time() - $wgUploadStashMaxAge;
@@ -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 = [];
@@ -129,7 +129,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 = [];