FIX: Assigning wrong value to variable.

This commit is contained in:
Guo Xiang Tan 2016-03-21 15:17:11 +08:00
parent 779f749642
commit 5dc5767851

View File

@ -64,13 +64,17 @@ store.redis_raw_connection = redis.without_namespace
severities = [Logger::WARN, Logger::ERROR, Logger::FATAL, Logger::UNKNOWN]
RailsMultisite::ConnectionManagement.each_connection do
if error_rate_per_minute = SiteSetting.alert_admins_if_errors_per_minute > 0
error_rate_per_minute = SiteSetting.alert_admins_if_errors_per_minute
if error_rate_per_minute > 0
store.register_rate_limit_per_minute(severities, error_rate_per_minute) do |rate|
MessageBus.publish("/logs_error_rate_exceeded", { rate: rate, duration: 'minute' })
end
end
if error_rate_per_hour = SiteSetting.alert_admins_if_errors_per_hour > 0
error_rate_per_hour = SiteSetting.alert_admins_if_errors_per_hour
if error_rate_per_hour > 0
store.register_rate_limit_per_hour(severities, error_rate_per_hour) do |rate|
MessageBus.publish("/logs_error_rate_exceeded", { rate: rate, duration: 'hour' })
end