]> git.wh0rd.org - tt-rss.git/commitdiff
ccache: skip non-numeric feeds (e.g. tags)
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 23 Jan 2009 13:49:31 +0000 (14:49 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 23 Jan 2009 13:49:31 +0000 (14:49 +0100)
backend.php
functions.php

index a2a87cafd69126d0baa458c80513fb5353faa76a..4343f0097e671878196d1ca640416e41d6aeaa01 100644 (file)
                        /* 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);
index 2b81a10c5f60784c95bb85154e9ab1d06ace9658..51be96f7a88aa1428e958f336b77b24b2be30ff3 100644 (file)
        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 {
        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