summaryrefslogtreecommitdiff
path: root/classes/RSSUtils.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2025-05-05 20:42:29 +0300
committerAndrew Dolgov <fox@fakecake.org>2025-05-05 20:45:40 +0300
commit070585ac5e7785ccea0dc421d3c5d8e603d618a3 (patch)
tree8426797d036379ef20bc283fbd2c6c06f94a06eb /classes/RSSUtils.php
parent6d11acc713d4f95375b06a6ee94d72d5bd0218cf (diff)
only open PDO transaction while performing CRUD operations on article
Diffstat (limited to 'classes/RSSUtils.php')
-rw-r--r--classes/RSSUtils.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/classes/RSSUtils.php b/classes/RSSUtils.php
index 7339a066d..fec9568da 100644
--- a/classes/RSSUtils.php
+++ b/classes/RSSUtils.php
@@ -702,8 +702,6 @@ class RSSUtils {
$tstart = time();
foreach ($items as $item) {
- $pdo->beginTransaction();
-
Debug::log(Debug::SEPARATOR, Debug::LOG_VERBOSE);
if (Debug::get_loglevel() >= 3) {
@@ -712,7 +710,6 @@ class RSSUtils {
if (ini_get("max_execution_time") > 0 && time() - $tstart >= ((float)ini_get("max_execution_time") * 0.7)) {
Debug::log("looks like there's too many articles to process at once, breaking out.", Debug::LOG_VERBOSE);
- $pdo->commit();
break;
}
@@ -721,7 +718,6 @@ class RSSUtils {
if (!$entry_guid) $entry_guid = self::make_guid_from_title($item->get_title());
if (!$entry_guid) {
- $pdo->commit();
continue;
}
@@ -848,8 +844,6 @@ class RSSUtils {
// dupes when the entry gets purged and reinserted again e.g.
// in the case of SLOW SLOW OMG SLOW updating feeds
- $pdo->commit();
-
ORM::for_table('ttrss_entries')
->find_one($base_entry_id)
->set('date_updated', Db::NOW())
@@ -1053,7 +1047,6 @@ class RSSUtils {
if (self::find_article_filter($article_filters, "filter")) {
Debug::log("article is filtered out, nothing to do.", Debug::LOG_VERBOSE);
- $pdo->commit();
continue;
}
@@ -1061,8 +1054,10 @@ class RSSUtils {
Debug::log("initial score: $score [including plugin modifier: $entry_score_modifier]", Debug::LOG_VERBOSE);
- // check for user post link to main table
+ Debug::log("begin pdo transaction...", Debug::LOG_VERBOSE);
+ $pdo->beginTransaction();
+ // check for user post link to main table
$sth = $pdo->prepare("SELECT ref_id, int_id FROM ttrss_user_entries WHERE
ref_id = ? AND owner_uid = ?");
$sth->execute([$ref_id, $feed_obj->owner_uid]);
@@ -1264,9 +1259,10 @@ class RSSUtils {
]);
}
- Debug::log("article processed.", Debug::LOG_VERBOSE);
-
+ Debug::log("commit pdo transaction...", Debug::LOG_VERBOSE);
$pdo->commit();
+
+ Debug::log("article processed.", Debug::LOG_VERBOSE);
}
Debug::log(Debug::SEPARATOR, Debug::LOG_VERBOSE);