summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-17 18:27:37 +0100
committerAndrew Dolgov <[email protected]>2009-01-17 18:27:37 +0100
commit34c30ac126cb1b00b36065b4dae705774c4e52b3 (patch)
tree3442743cc7d1673baf07a515492858db55576187 /backend.php
parent51e196dee92b3eff71f078db510a31be5d0c49c0 (diff)
viewfeed: rate limit ccache_update
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/backend.php b/backend.php
index 1e60e392d..210de06f9 100644
--- a/backend.php
+++ b/backend.php
@@ -273,8 +273,11 @@
/* 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);