From 5c432ba490b05c336ae1af9bafee9a6badfbfd99 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 23 Jan 2009 14:49:31 +0100 Subject: ccache: skip non-numeric feeds (e.g. tags) --- backend.php | 4 ++-- functions.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend.php b/backend.php index a2a87cafd..4343f0097 100644 --- a/backend.php +++ b/backend.php @@ -275,12 +275,12 @@ /* Updating a label ccache means recalculating all of the caches * so for performance reasons we don't do that here */ - if (time() - $_SESSION["viewfeed:ccache_update_stamp"] > 120) { +// if (time() - $_SESSION["viewfeed:ccache_update_stamp"] > 120) { if ($feed >= 0) { ccache_update($link, $feed, $_SESSION["uid"], $cat_view); } $_SESSION["viewfeed:ccache_update_stamp"] = time(); - } +// } set_pref($link, "_DEFAULT_VIEW_MODE", $view_mode); set_pref($link, "_DEFAULT_VIEW_LIMIT", $limit); diff --git a/functions.php b/functions.php index 2b81a10c5..51be96f7a 100644 --- a/functions.php +++ b/functions.php @@ -5684,6 +5684,8 @@ function ccache_find($link, $feed_id, $owner_uid, $is_cat = false, $no_update = false) { + if (!is_numeric($feed_id)) return; + if (!$is_cat) { $table = "ttrss_counters_cache"; } else { @@ -5715,6 +5717,8 @@ function ccache_update($link, $feed_id, $owner_uid, $is_cat = false, $update_pcat = true) { + if (!is_numeric($feed_id)) return; + $prev_unread = ccache_find($link, $feed_id, $owner_uid, $is_cat, true); /* When updating a label, all we need to do is recalculate feed counters -- cgit v1.2.3