r113443 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113442‎ | r113443 | r113444 >
Date:01:24, 9 March 2012
Author:aaron
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1/includes (modified) (history)
  • /branches/wmf/1.19wmf1/includes/filerepo/FileRepo.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/filerepo/file/ForeignAPIFile.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php
@@ -763,7 +763,7 @@
764764 }
765765
766766 # Delete the thumbnails
767 - $this->repo->cleanupBatch( $purgeList );
 767+ $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING );
768768 # Clear out the thumbnail directory if empty
769769 $this->repo->getBackend()->clean( array( 'dir' => $dir ) );
770770 }
Index: branches/wmf/1.19wmf1/includes/filerepo/file/ForeignAPIFile.php
@@ -245,7 +245,7 @@
246246 }
247247
248248 # Delete the thumbnails
249 - $this->repo->cleanupBatch( $purgeList );
 249+ $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING );
250250 # Clear out the thumbnail directory if empty
251251 $this->repo->getBackend()->clean( array( 'dir' => $dir ) );
252252 }
Index: branches/wmf/1.19wmf1/includes/filerepo/FileRepo.php
@@ -733,9 +733,11 @@
734734 * It will try to delete each file, but ignores any errors that may occur.
735735 *
736736 * @param $pairs array List of files to delete
 737+ * @param $flags Integer: bitwise combination of the following flags:
 738+ * self::SKIP_LOCKING Skip any file locking when doing the deletions
737739 * @return void
738740 */
739 - public function cleanupBatch( $files ) {
 741+ public function cleanupBatch( $files, $flags = 0 ) {
740742 $operations = array();
741743 $sourceFSFilesToDelete = array(); // cleanup for disk source files
742744 foreach ( $files as $file ) {
@@ -765,6 +767,9 @@
766768 }
767769 // Actually delete files from storage...
768770 $opts = array( 'force' => true );
 771+ if ( $flags & self::SKIP_LOCKING ) {
 772+ $opts['nonLocking'] = true;
 773+ }
769774 $this->backend->doOperations( $operations, $opts );
770775 // Cleanup for disk source files...
771776 foreach ( $sourceFSFilesToDelete as $file ) {
Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
772777 Merged /trunk/phase3/includes:r113441

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113441Disable file locking for thumbnail purging just as it already is with creatio...aaron01:18, 9 March 2012

Status & tagging log