https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113443

Revision: 113443
Author:   aaron
Date:     2012-03-09 01:24:43 +0000 (Fri, 09 Mar 2012)
Log Message:
-----------
MFT r113441

Modified Paths:
--------------
    branches/wmf/1.19wmf1/includes/filerepo/FileRepo.php
    branches/wmf/1.19wmf1/includes/filerepo/file/ForeignAPIFile.php
    branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php

Property Changed:
----------------
    branches/wmf/1.19wmf1/includes/


Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/JSTesting/includes:100352-107913
/branches/REL1_15/phase3/includes:51646
/branches/new-installer/phase3/includes:43664-66004
/branches/sqlite/includes:58211-58321
/branches/wmf/1.18wmf1/includes:97508,111667
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:111029,111034,111067,111085,111128,111144,111251,111397,111427,111571,111574,111597,111658,111673,111695,111697,111750,111827,111965-111967,112021,112045-112046,112049,112061-112063,112065-112066,112070-112071,112079,112128,112132-112133,112152,112184,112259,112290,112347,112374,112378,112381,112383,112397,112408,112474,112526,112534,112563,112700,112839-112840,112843,112855,112866,112951,112995,113099,113169,113195,113312,113412
   + /branches/JSTesting/includes:100352-107913
/branches/REL1_15/phase3/includes:51646
/branches/new-installer/phase3/includes:43664-66004
/branches/sqlite/includes:58211-58321
/branches/wmf/1.18wmf1/includes:97508,111667
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:111029,111034,111067,111085,111128,111144,111251,111397,111427,111571,111574,111597,111658,111673,111695,111697,111750,111827,111965-111967,112021,112045-112046,112049,112061-112063,112065-112066,112070-112071,112079,112128,112132-112133,112152,112184,112259,112290,112347,112374,112378,112381,112383,112397,112408,112474,112526,112534,112563,112700,112839-112840,112843,112855,112866,112951,112995,113099,113169,113195,113312,113412,113441

Modified: branches/wmf/1.19wmf1/includes/filerepo/FileRepo.php
===================================================================
--- branches/wmf/1.19wmf1/includes/filerepo/FileRepo.php        2012-03-09 
01:21:46 UTC (rev 113442)
+++ branches/wmf/1.19wmf1/includes/filerepo/FileRepo.php        2012-03-09 
01:24:43 UTC (rev 113443)
@@ -733,9 +733,11 @@
         * It will try to delete each file, but ignores any errors that may 
occur.
         *
         * @param $pairs array List of files to delete
+        * @param $flags Integer: bitwise combination of the following flags:
+        *     self::SKIP_LOCKING      Skip any file locking when doing the 
deletions
         * @return void
         */
-       public function cleanupBatch( $files ) {
+       public function cleanupBatch( $files, $flags = 0 ) {
                $operations = array();
                $sourceFSFilesToDelete = array(); // cleanup for disk source 
files
                foreach ( $files as $file ) {
@@ -765,6 +767,9 @@
                }
                // Actually delete files from storage...
                $opts = array( 'force' => true );
+               if ( $flags & self::SKIP_LOCKING ) {
+                       $opts['nonLocking'] = true;
+               }
                $this->backend->doOperations( $operations, $opts );
                // Cleanup for disk source files...
                foreach ( $sourceFSFilesToDelete as $file ) {

Modified: branches/wmf/1.19wmf1/includes/filerepo/file/ForeignAPIFile.php
===================================================================
--- branches/wmf/1.19wmf1/includes/filerepo/file/ForeignAPIFile.php     
2012-03-09 01:21:46 UTC (rev 113442)
+++ branches/wmf/1.19wmf1/includes/filerepo/file/ForeignAPIFile.php     
2012-03-09 01:24:43 UTC (rev 113443)
@@ -245,7 +245,7 @@
                }
 
                # Delete the thumbnails
-               $this->repo->cleanupBatch( $purgeList );
+               $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING );
                # Clear out the thumbnail directory if empty
                $this->repo->getBackend()->clean( array( 'dir' => $dir ) );
        }

Modified: branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php
===================================================================
--- branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php  2012-03-09 
01:21:46 UTC (rev 113442)
+++ branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php  2012-03-09 
01:24:43 UTC (rev 113443)
@@ -763,7 +763,7 @@
                }
 
                # Delete the thumbnails
-               $this->repo->cleanupBatch( $purgeList );
+               $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING );
                # Clear out the thumbnail directory if empty
                $this->repo->getBackend()->clean( array( 'dir' => $dir ) );
        }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to