From f55b0b12aa7961b4dcb52041963cd35d8fc0da53 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 16 Jan 2009 16:33:26 +0100 Subject: [PATCH] ccache category fixes; re-enable rate limit --- feedlist.js | 8 ++------ functions.php | 11 ++++------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/feedlist.js b/feedlist.js index c756f144..d4adacb6 100644 --- a/feedlist.js +++ b/feedlist.js @@ -623,17 +623,13 @@ function request_counters() { // if (getInitParam("sync_counters") == "1" || // timestamp - counters_last_request > 10) { -/* if (timestamp - counters_last_request > 10) { - + if (timestamp - counters_last_request > 5) { debug("scheduling request of counters..."); window.setTimeout("request_counters_real()", 1000); counters_last_request = timestamp; } else { debug("request_counters: rate limit reached: " + (timestamp - counters_last_request)); - } */ - - window.setTimeout("request_counters_real()", 1000); - counters_last_request = timestamp; + } } catch (e) { exception_error("request_counters", e); diff --git a/functions.php b/functions.php index ce0360c8..53ad3ce7 100644 --- a/functions.php +++ b/functions.php @@ -4208,7 +4208,7 @@ function printCategoryHeader($link, $cat_id, $hidden = false, $can_browse = true) { $tmp_category = getCategoryTitle($link, $cat_id); - $cat_unread = getCategoryUnread($link, $cat_id); + $cat_unread = ccache_find($link, $cat_id, $_SESSION["uid"], true); if ($hidden) { $holder_style = "display:none;"; @@ -6058,12 +6058,7 @@ $table = "ttrss_cat_counters_cache"; } - if (!$is_cat) { - - $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid); - - } else { - + if ($is_cat && $feed_id > 0) { if ($feed_id != 0) { $cat_qpart = "cat_id = '$feed_id'"; } else { @@ -6077,6 +6072,8 @@ $unread = db_fetch_result($result, 0, "sv"); + } else { + $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid); } $result = db_query($link, "SELECT feed_id FROM $table -- 2.39.5