Index: trunk/phase3/includes/filerepo/file/LocalFile.php |
— | — | @@ -770,7 +770,7 @@ |
771 | 771 | } |
772 | 772 | |
773 | 773 | # Delete the thumbnails |
774 | | - $this->repo->cleanupBatch( $purgeList ); |
| 774 | + $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING ); |
775 | 775 | # Clear out the thumbnail directory if empty |
776 | 776 | $this->repo->getBackend()->clean( array( 'dir' => $dir ) ); |
777 | 777 | } |
Index: trunk/phase3/includes/filerepo/file/ForeignAPIFile.php |
— | — | @@ -247,7 +247,7 @@ |
248 | 248 | } |
249 | 249 | |
250 | 250 | # Delete the thumbnails |
251 | | - $this->repo->cleanupBatch( $purgeList ); |
| 251 | + $this->repo->cleanupBatch( $purgeList, FileRepo::SKIP_LOCKING ); |
252 | 252 | # Clear out the thumbnail directory if empty |
253 | 253 | $this->repo->getBackend()->clean( array( 'dir' => $dir ) ); |
254 | 254 | } |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -735,9 +735,11 @@ |
736 | 736 | * It will try to delete each file, but ignores any errors that may occur. |
737 | 737 | * |
738 | 738 | * @param $pairs array List of files to delete |
| 739 | + * @param $flags Integer: bitwise combination of the following flags: |
| 740 | + * self::SKIP_LOCKING Skip any file locking when doing the deletions |
739 | 741 | * @return void |
740 | 742 | */ |
741 | | - public function cleanupBatch( $files ) { |
| 743 | + public function cleanupBatch( $files, $flags = 0 ) { |
742 | 744 | $operations = array(); |
743 | 745 | $sourceFSFilesToDelete = array(); // cleanup for disk source files |
744 | 746 | foreach ( $files as $file ) { |
— | — | @@ -767,6 +769,9 @@ |
768 | 770 | } |
769 | 771 | // Actually delete files from storage... |
770 | 772 | $opts = array( 'force' => true ); |
| 773 | + if ( $flags & self::SKIP_LOCKING ) { |
| 774 | + $opts['nonLocking'] = true; |
| 775 | + } |
771 | 776 | $this->backend->doOperations( $operations, $opts ); |
772 | 777 | // Cleanup for disk source files... |
773 | 778 | foreach ( $sourceFSFilesToDelete as $file ) { |