Commit 3769665b authored by Dries's avatar Dries

- Refactored the throttle module. Patch by Jeremy and me.

  * There are only two throttle levels instead of 5, namely 'enabled' and 'disabled'.  This makes it a _lot_ easier to predict when the throttle will kick in.  However, if you maintain a module that is throttle-aware, it needs to be updated!

  * The throttle mechanism now uses the current number of anonymous users or the current number of authenticated users to kick in.  This is a _lot_ more intuitive than the old throttle mechanism.

  * The throttle block has been removed -- you can now use the "Who's online" block to determine the good throttle settings.

  * Most of the documentation has been removed because it was deprecated.

  * It's less code!
parent f01bd675
......@@ -9,6 +9,8 @@ Drupal x.x.x, xxxx-xx-xx
* improved search output.
- syndication:
* added support for RSS ping-notifications of http://technorati.com/.
- usability:
* refactored the throttle module configuration.
- performance:
* improved performance of the tracker module.
......
......@@ -59,7 +59,7 @@ function module_list($refresh = FALSE, $bootstrap = FALSE) {
// Determine the current throttle status and see if the module should be
// loaded based on server load. We have to directly access the throttle
// variables, since throttle.module may not be loaded yet.
$throttle = ($module->throttle && variable_get('throttle_level', 0) > 4);
$throttle = ($module->throttle && variable_get('throttle_level', 0) > 0);
if (!$throttle) {
$list[$module->name] = $module->name;
module_set_filename($module->name, $module->filename);
......
......@@ -422,7 +422,7 @@ function block_list($region) {
if ($enabled && $matched) {
// Check the current throttle status and see if block should be displayed
// based on server load.
if (!($block['throttle'] && (module_invoke('throttle', 'status') > 4))) {
if (!($block['throttle'] && (module_invoke('throttle', 'status') > 0))) {
$array = module_invoke($block['module'], 'block', 'view', $block['delta']);
if (is_array($array)) {
$block = array_merge($block, $array);
......
......@@ -422,7 +422,7 @@ function block_list($region) {
if ($enabled && $matched) {
// Check the current throttle status and see if block should be displayed
// based on server load.
if (!($block['throttle'] && (module_invoke('throttle', 'status') > 4))) {
if (!($block['throttle'] && (module_invoke('throttle', 'status') > 0))) {
$array = module_invoke($block['module'], 'block', 'view', $block['delta']);
if (is_array($array)) {
$block = array_merge($block, $array);
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment