Improved performance of spider cronjob
authorAlexander Ebert <ebert@woltlab.com>
Wed, 14 Aug 2013 15:43:29 +0000 (17:43 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 14 Aug 2013 15:43:29 +0000 (17:43 +0200)
wcfsetup/install/files/lib/data/option/OptionEditor.class.php
wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php

index ae88e2fd9c9d98a86fa676aad6daee5a98fd4f81..6b5859e08fc8a47312fadb55c2d4ec9cc0bf0bd0 100644 (file)
@@ -75,6 +75,7 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject
                $statement = WCF::getDB()->prepareStatement($sql);
                
                $flushCache = false;
+               WCF::getDB()->beginTransaction();
                foreach ($options as $id => $value) {
                        if ($id == $row['optionID'] && ($value != $row['optionValue'] || $value != CACHE_SOURCE_TYPE)) {
                                $flushCache = true;
@@ -85,6 +86,7 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                $id
                        ));
                }
+               WCF::getDB()->commitTransaction();
                
                // force a cache reset if options were changed
                self::resetCache();
index a603345314c92ae90b94a5ca39ecd090fa4b5b91..e13e0ab8801603c34cd6a943bf387461f017b1d8 100644 (file)
@@ -56,6 +56,7 @@ class RefreshSearchRobotsCronjob implements ICronjob {
                                        VALUES          (?, ?, ?)";
                                $statement = WCF::getDB()->prepareStatement($sql);
                                
+                               WCF::getDB()->beginTransaction();
                                foreach ($statementParameters as $parameters) {
                                        $statement->execute(array(
                                                $parameters['spiderIdentifier'],
@@ -63,6 +64,7 @@ class RefreshSearchRobotsCronjob implements ICronjob {
                                                $parameters['spiderURL']
                                        ));
                                }
+                               WCF::getDB()->commitTransaction();
                        }
                        
                        // clear spider cache