Index: branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php |
— | — | @@ -763,7 +763,7 @@ |
764 | 764 | } |
765 | 765 | |
766 | 766 | # Delete the thumbnails |
767 | | - $this->repo->cleanupBatch( $purgeList ); |
| 767 | + $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING ); |
768 | 768 | # Clear out the thumbnail directory if empty |
769 | 769 | $this->repo->getBackend()->clean( array( 'dir' => $dir ) ); |
770 | 770 | } |
Index: branches/wmf/1.19wmf1/includes/filerepo/file/ForeignAPIFile.php |
— | — | @@ -245,7 +245,7 @@ |
246 | 246 | } |
247 | 247 | |
248 | 248 | # Delete the thumbnails |
249 | | - $this->repo->cleanupBatch( $purgeList ); |
| 249 | + $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING ); |
250 | 250 | # Clear out the thumbnail directory if empty |
251 | 251 | $this->repo->getBackend()->clean( array( 'dir' => $dir ) ); |
252 | 252 | } |
Index: branches/wmf/1.19wmf1/includes/filerepo/FileRepo.php |
— | — | @@ -733,9 +733,11 @@ |
734 | 734 | * It will try to delete each file, but ignores any errors that may occur. |
735 | 735 | * |
736 | 736 | * @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 |
737 | 739 | * @return void |
738 | 740 | */ |
739 | | - public function cleanupBatch( $files ) { |
| 741 | + public function cleanupBatch( $files, $flags = 0 ) { |
740 | 742 | $operations = array(); |
741 | 743 | $sourceFSFilesToDelete = array(); // cleanup for disk source files |
742 | 744 | foreach ( $files as $file ) { |
— | — | @@ -765,6 +767,9 @@ |
766 | 768 | } |
767 | 769 | // Actually delete files from storage... |
768 | 770 | $opts = array( 'force' => true ); |
| 771 | + if ( $flags & self::SKIP_LOCKING ) { |
| 772 | + $opts['nonLocking'] = true; |
| 773 | + } |
769 | 774 | $this->backend->doOperations( $operations, $opts ); |
770 | 775 | // Cleanup for disk source files... |
771 | 776 | foreach ( $sourceFSFilesToDelete as $file ) { |
Property changes on: branches/wmf/1.19wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
772 | 777 | Merged /trunk/phase3/includes:r113441 |