1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-02-10 16:01:33 +00:00

rssutils: PDO

This commit is contained in:
Andrew Dolgov
2017-12-02 09:55:53 +03:00
parent afcb105f4e
commit 0567016b40
2 changed files with 294 additions and 289 deletions

View File

@@ -142,7 +142,13 @@ class CCache {
$unread = (int) Feeds::getFeedArticles($feed_id, $is_cat, true, $owner_uid);
}
$pdo->beginTransaction();
$tr_in_progress = false;
try {
$pdo->beginTransaction();
} catch (Exception $e) {
$tr_in_progress = true;
}
$sth = $pdo->prepare("SELECT feed_id FROM $table
WHERE owner_uid = ? AND feed_id = ? LIMIT 1");
@@ -164,7 +170,7 @@ class CCache {
$sth->execute([$feed_id, $unread, $owner_uid]);
}
$pdo->commit();
if (!$tr_in_progress) $pdo->commit();
if ($feed_id > 0 && $prev_unread != $unread) {