* 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 ) {
}
// 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 ) {
}
# 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 ) );
}
}
# 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 ) );
}