Processing 100 instead of 50 comments per iteration
authorAlexander Ebert <ebert@woltlab.com>
Sun, 1 Feb 2015 17:50:38 +0000 (18:50 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 1 Feb 2015 17:50:38 +0000 (18:50 +0100)
wcfsetup/install/files/acp/rebuild_comments_com.woltlab.wcf_2.1.php

index 78f6c68b23db36a81f0b3a2f4f4ab64a756df55f..0bb43e4d092f4dc34f454d663d0f83a91168fcdf 100644 (file)
@@ -9,6 +9,7 @@ use wcf\system\WCF;
  * @package    com.woltlab.wcf
  * @category   Community Framework
  */
+$commentsPerRun = 100;
 $rebuildData = WCF::getSession()->getVar('__wcfUpdateRebuildComments');
 if ($rebuildData === null) {
        $sql = "SELECT  COUNT(*) AS count
@@ -24,19 +25,19 @@ if ($rebuildData === null) {
        );
        
        if ($row['count']) {
-               $rebuildData['max'] = ceil($row['count'] / 50);
+               $rebuildData['max'] = ceil($row['count'] / $commentsPerRun);
        }
 }
 
 if ($rebuildData['max']) {
-       $offset = $rebuildData['i'] * 50;
+       $offset = $rebuildData['i'] * $commentsPerRun;
        
        // get comments
        $sql = "SELECT          commentID
                FROM            wcf".WCF_N."_comment
                WHERE           responses > ?
                ORDER BY        commentID";
-       $statement = WCF::getDB()->prepareStatement($sql, 50, $offset);
+       $statement = WCF::getDB()->prepareStatement($sql, $commentsPerRun, $offset);
        $statement->execute(array(3));
        
        $commentData = array();