getAllCounters: add rate limit (5 sec)
This commit is contained in:
parent
4d0b36070a
commit
d9e4bba015
|
@ -2199,13 +2199,11 @@
|
|||
}
|
||||
|
||||
function getAllCounters($link, $omode = "flc", $active_feed = false) {
|
||||
/* getLabelCounters($link);
|
||||
getFeedCounters($link);
|
||||
getTagCounters($link);
|
||||
getGlobalCounters($link);
|
||||
if (get_pref($link, 'ENABLE_FEED_CATS')) {
|
||||
getCategoryCounters($link);
|
||||
} */
|
||||
|
||||
/* getting all counters is a resource intensive operation, so we
|
||||
* rate limit it a little bit */
|
||||
|
||||
if (time() - $_SESSION["get_all_counters_stamp"] > 5) {
|
||||
|
||||
if (!$omode) $omode = "flc";
|
||||
|
||||
|
@ -2219,6 +2217,10 @@
|
|||
getCategoryCounters($link);
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION["get_all_counters_stamp"] = time();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getCategoryCounters($link) {
|
||||
|
|
Loading…
Reference in New Issue