Commit 5c415f73 authored by Dries's avatar Dries
Browse files

- Slightly improved the throttle watchdog messages.

parent 18160f02
...@@ -166,14 +166,16 @@ function _throttle_update($hits) { ...@@ -166,14 +166,16 @@ function _throttle_update($hits) {
} }
} }
$type = $throttle_new > 2 ? 'warning' : 'regular';
// log the change // log the change
if ($throttle_new < $throttle) { if ($throttle_new < $throttle) {
variable_set('throttle_level', $throttle - 1); variable_set('throttle_level', $throttle - 1);
watchdog('regular', "message: '$hits' hits in past minute; throttle decreased to level ". ($throttle - 1)); watchdog($type, "throttle: '$hits' hits in past minute; throttle decreased to level ". ($throttle - 1));
} }
if ($throttle_new > $throttle) { if ($throttle_new > $throttle) {
variable_set('throttle_level', $throttle + 1); variable_set('throttle_level', $throttle + 1);
watchdog('warning', "warning: '$hits' hits in past minute; throttle increased to level ". ($throttle + 1)); watchdog($type, "throttle: '$hits' hits in past minute; throttle increased to level ". ($throttle + 1));
} }
} }
......
...@@ -166,14 +166,16 @@ function _throttle_update($hits) { ...@@ -166,14 +166,16 @@ function _throttle_update($hits) {
} }
} }
$type = $throttle_new > 2 ? 'warning' : 'regular';
// log the change // log the change
if ($throttle_new < $throttle) { if ($throttle_new < $throttle) {
variable_set('throttle_level', $throttle - 1); variable_set('throttle_level', $throttle - 1);
watchdog('regular', "message: '$hits' hits in past minute; throttle decreased to level ". ($throttle - 1)); watchdog($type, "throttle: '$hits' hits in past minute; throttle decreased to level ". ($throttle - 1));
} }
if ($throttle_new > $throttle) { if ($throttle_new > $throttle) {
variable_set('throttle_level', $throttle + 1); variable_set('throttle_level', $throttle + 1);
watchdog('warning', "warning: '$hits' hits in past minute; throttle increased to level ". ($throttle + 1)); watchdog($type, "throttle: '$hits' hits in past minute; throttle increased to level ". ($throttle + 1));
} }
} }
......
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