]> git.wh0rd.org Git - tt-rss.git/commitdiff
viewfeed: rate limit ccache_update
authorAndrew Dolgov <fox@madoka.spb.ru>
Sat, 17 Jan 2009 17:27:37 +0000 (18:27 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Sat, 17 Jan 2009 17:27:37 +0000 (18:27 +0100)
backend.php

index 1e60e392d0445f5826e22b206c7c907b122438da..210de06f9e9fe44123381475316305135d73a481 100644 (file)
                        /* 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);
+                       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);