FIX: If site settings are missing don't do anything

This commit is contained in:
Robin Ward 2016-03-24 11:12:38 -04:00
parent da2f1fda15
commit b270e0142b
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ store.redis_raw_connection = redis.without_namespace
severities = [Logger::WARN, Logger::ERROR, Logger::FATAL, Logger::UNKNOWN]
RailsMultisite::ConnectionManagement.each_connection do
error_rate_per_minute = SiteSetting.alert_admins_if_errors_per_minute
error_rate_per_minute = SiteSetting.alert_admins_if_errors_per_minute rescue 0
if error_rate_per_minute > 0
store.register_rate_limit_per_minute(severities, error_rate_per_minute) do |rate|
@ -72,7 +72,7 @@ RailsMultisite::ConnectionManagement.each_connection do
end
end
error_rate_per_hour = SiteSetting.alert_admins_if_errors_per_hour
error_rate_per_hour = SiteSetting.alert_admins_if_errors_per_hour rescue 0
if error_rate_per_hour > 0
store.register_rate_limit_per_hour(severities, error_rate_per_hour) do |rate|