A free, self-hostable news aggregator…
Improve SQL transactions (#6713)
Alexandre Alapetite1fad724b951d
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.phpindex 396649701..dbdf858a7 100644--- a/app/Controllers/feedController.php+++ b/app/Controllers/feedController.php@@ -800,9 +800,9 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {*/public static function actualizeFeedsAndCommit(?int $feed_id = null, ?string $feed_url = null, ?int $maxFeeds = null, ?SimplePie $simplePiePush = null): array {$entryDAO = FreshRSS_Factory::createEntryDao();- $entryDAO->beginTransaction();[$nbUpdatedFeeds, $feed, $nbNewArticles, $feedsCacheToRefresh] = FreshRSS_feed_Controller::actualizeFeeds($feed_id, $feed_url, $maxFeeds, $simplePiePush);if ($nbNewArticles > 0) {+ $entryDAO->beginTransaction();FreshRSS_feed_Controller::commitNewEntries();}if (count($feedsCacheToRefresh) > 0) {@@ -852,10 +852,10 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {FreshRSS_category_Controller::refreshDynamicOpmls();}$entryDAO = FreshRSS_Factory::createEntryDao();- $entryDAO->beginTransaction();[$nbUpdatedFeeds, $feed, $nbNewArticles, $feedsCacheToRefresh] = self::actualizeFeeds($id, $url, $maxFeeds);if (!$noCommit) {if ($nbNewArticles > 0) {+ $entryDAO->beginTransaction();FreshRSS_feed_Controller::commitNewEntries();}$feedDAO = FreshRSS_Factory::createFeedDao();