Skip to content

Commit

Permalink
Improve SQL transactions (FreshRSS#6713)
Browse files Browse the repository at this point in the history
To avoid some locks.
Fix FreshRSS#6686
Might be some regressions since FreshRSS#6632
  • Loading branch information
Alkarex authored Aug 15, 2024
1 parent 692e304 commit 1fad724
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Controllers/feedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,9 @@ public static function commitNewEntries(): int {
*/
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) {
Expand Down Expand Up @@ -852,10 +852,10 @@ public function actualizeAction(): int {
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();
Expand Down

0 comments on commit 1fad724

Please sign in to comment.