aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-08-15 21:39:33 +0200
committerGravatar GitHub <noreply@github.com> 2024-08-15 21:39:33 +0200
commit1fad724b951d1f804be03362a855f9d50ab4acc9 (patch)
treed316bef03965b6e3622feea585529012f4706a9a /app
parent692e30465dd0b0dcd302eccc26af34148d17667b (diff)
Improve SQL transactions (#6713)
To avoid some locks. Fix https://github.com/FreshRSS/FreshRSS/issues/6686 Might be some regressions since https://github.com/FreshRSS/FreshRSS/pull/6632
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/feedController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 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();