From: Andrew Dolgov Date: Sat, 17 Jan 2009 17:27:37 +0000 (+0100) Subject: viewfeed: rate limit ccache_update X-Git-Tag: 1.3.0~109 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=34c30ac126cb1b00b36065b4dae705774c4e52b3;p=tt-rss.git viewfeed: rate limit ccache_update --- diff --git a/backend.php b/backend.php index 1e60e392..210de06f 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);