Fixed attachment worker
authorMarcel Werk <burntime@woltlab.com>
Fri, 12 Jul 2013 19:43:19 +0000 (21:43 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 12 Jul 2013 19:43:19 +0000 (21:43 +0200)
wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php

index 5497775aae1831bc363a61b3ef70bab142496218..a2d819154e8ca6f9574c6b58beeb9377736e2eed 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\worker;
 use wcf\data\attachment\AttachmentAction;
+use wcf\system\exception\SystemException;
 
 /**
  * Worker implementation for updating attachments.
@@ -21,7 +22,7 @@ class AttachmentRebuildDataWorker extends AbstractRebuildDataWorker {
        /**
         * @see wcf\system\worker\AbstractWorker::$limit
         */
-       protected $limit = 50;
+       protected $limit = 10;
        
        /**
         * @see wcf\system\worker\AbstractRebuildDataWorker::initObjectList
@@ -39,7 +40,12 @@ class AttachmentRebuildDataWorker extends AbstractRebuildDataWorker {
        public function execute() {
                parent::execute();
                
-               $action = new AttachmentAction($this->objectList->getObjects(), 'generateThumbnails');
-               $action->executeAction();
+               foreach ($this->objectList as $attachment) {
+                       try {
+                               $action = new AttachmentAction(array($attachment), 'generateThumbnails');
+                               $action->executeAction();
+                       }
+                       catch (SystemException $e) {}
+               }
        }
 }