mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 04:52:45 +08:00
FIX: Also support nil
values for the site settings
This commit is contained in:
parent
b270e0142b
commit
e407ef9d0e
|
@ -66,7 +66,7 @@ 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 rescue 0
|
||||
|
||||
if error_rate_per_minute > 0
|
||||
if (error_rate_per_minute || 0) > 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
|
||||
|
@ -74,7 +74,7 @@ RailsMultisite::ConnectionManagement.each_connection do
|
|||
|
||||
error_rate_per_hour = SiteSetting.alert_admins_if_errors_per_hour rescue 0
|
||||
|
||||
if error_rate_per_hour > 0
|
||||
if (error_rate_per_hour || 0) > 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
|
||||
|
|
Loading…
Reference in New Issue
Block a user