From: Alexander Ebert Date: Wed, 14 Aug 2013 15:43:29 +0000 (+0200) Subject: Improved performance of spider cronjob X-Git-Tag: 2.0.0_Beta_7~18^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=baee28c49637b69948aec34cd84e38a7c18dcc91;p=GitHub%2FWoltLab%2FWCF.git Improved performance of spider cronjob --- diff --git a/wcfsetup/install/files/lib/data/option/OptionEditor.class.php b/wcfsetup/install/files/lib/data/option/OptionEditor.class.php index ae88e2fd9c..6b5859e08f 100644 --- a/wcfsetup/install/files/lib/data/option/OptionEditor.class.php +++ b/wcfsetup/install/files/lib/data/option/OptionEditor.class.php @@ -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(); diff --git a/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php index a603345314..e13e0ab880 100644 --- a/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php @@ -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