diff options
Diffstat (limited to 'modules/throttle')
-rw-r--r-- | modules/throttle/throttle.module | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/throttle/throttle.module b/modules/throttle/throttle.module index 5186fd60e..f94a79f79 100644 --- a/modules/throttle/throttle.module +++ b/modules/throttle/throttle.module @@ -155,9 +155,11 @@ function throttle_display_throttle_block() { $output .= t("Current level: %level (%min+)", array("%level" => $throttle, "%min" => $minimum)) ."<br />\n"; } $output .= t("Probability: %probability%", array("%probability" => $probability)) ."<br />\n"; - $recent_activity = db_fetch_object(db_query("SELECT COUNT(timestamp) AS hits FROM {accesslog} WHERE timestamp >= %d", (time() - 60))); - $output .= "<br />". t("This site has served %hits in the past minute.", array("%hits" => format_plural($recent_activity->hits , "1 page", "%count pages"))); - _throttle_update($recent_activity->hits); + if ($throttle < 5) { + $recent_activity = db_fetch_object(db_query("SELECT COUNT(timestamp) AS hits FROM {accesslog} WHERE timestamp >= %d", (time() - 60))); + $output .= "<br />". t("This site has served %pages in the past minute.", array("%pages" => format_plural($recent_activity->hits , "1 page", "%count pages"))); + _throttle_update($recent_activity->hits); + } } else { $output .= t("Throttle: %status", array("%status" => l(t("disabled"), "admin/system/modules/throttle"))) ."<br />\n"; |