From 51e196dee92b3eff71f078db510a31be5d0c49c0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 17 Jan 2009 18:23:12 +0100 Subject: [PATCH] fix ccache_update() failure when called for labels --- backend.php | 7 ++++++- functions.php | 4 +--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend.php b/backend.php index 5d25ba30..1e60e392 100644 --- a/backend.php +++ b/backend.php @@ -270,7 +270,12 @@ $csync = $_GET["csync"]; $order_by = db_escape_string($_GET["order_by"]); - ccache_update($link, $feed, $_SESSION["uid"], $cat_view); + /* Updating a label ccache means recalculating all of the caches + * so for performance reasons we don't do that here */ + + if ($feed >= 0) { + ccache_update($link, $feed, $_SESSION["uid"], $cat_view); + } set_pref($link, "_DEFAULT_VIEW_MODE", $view_mode); set_pref($link, "_DEFAULT_VIEW_LIMIT", $limit); diff --git a/functions.php b/functions.php index 673b0b26..c738ebe6 100644 --- a/functions.php +++ b/functions.php @@ -5938,7 +5938,6 @@ ccache_update($link, 0, $owner_uid, true); - } else { $result = db_query($link, "SELECT feed_id FROM ttrss_counters_cache WHERE feed_id > 0 AND owner_uid = '$owner_uid'"); @@ -6022,7 +6021,7 @@ WHERE id = feed_id AND $cat_qpart AND ttrss_feeds.owner_uid = '$owner_uid'"); - $unread = db_fetch_result($result, 0, "sv"); + $unread = (int) db_fetch_result($result, 0, "sv"); } else { $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid); @@ -6041,7 +6040,6 @@ (feed_id, value, owner_uid, updated) VALUES ($feed_id, $unread, $owner_uid, NOW())"); - } if ($feed_id > 0 && $prev_unread != $unread) { -- 2.39.5