getAllCounters: add rate limit (5 sec)

This commit is contained in:
Andrew Dolgov 2008-05-19 12:54:16 +01:00
parent 4d0b36070a
commit d9e4bba015
1 changed files with 17 additions and 15 deletions

View File

@ -2199,13 +2199,11 @@
} }
function getAllCounters($link, $omode = "flc", $active_feed = false) { function getAllCounters($link, $omode = "flc", $active_feed = false) {
/* getLabelCounters($link);
getFeedCounters($link); /* getting all counters is a resource intensive operation, so we
getTagCounters($link); * rate limit it a little bit */
getGlobalCounters($link);
if (get_pref($link, 'ENABLE_FEED_CATS')) { if (time() - $_SESSION["get_all_counters_stamp"] > 5) {
getCategoryCounters($link);
} */
if (!$omode) $omode = "flc"; if (!$omode) $omode = "flc";
@ -2219,6 +2217,10 @@
getCategoryCounters($link); getCategoryCounters($link);
} }
} }
$_SESSION["get_all_counters_stamp"] = time();
}
} }
function getCategoryCounters($link) { function getCategoryCounters($link) {