Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
This commit is contained in:
4
config/initializers/rack_attack_logging.rb
Normal file
4
config/initializers/rack_attack_logging.rb
Normal file
@ -0,0 +1,4 @@
|
||||
ActiveSupport::Notifications.subscribe('rack.attack') do |_name, _start, _finish, _request_id, req|
|
||||
next unless [:throttle, :blacklist].include? req.env['rack.attack.match_type']
|
||||
Rails.logger.info("Rate limit hit (#{req.env['rack.attack.match_type']}): #{req.ip} #{req.request_method} #{req.fullpath}")
|
||||
end
|
@ -1,10 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
namespace = ENV.fetch('REDIS_NAMESPACE') { nil }
|
||||
namespace = ENV.fetch('REDIS_NAMESPACE') { nil }
|
||||
redis_params = { url: ENV['REDIS_URL'] }
|
||||
|
||||
if namespace
|
||||
redis_params [:namespace] = namespace
|
||||
redis_params[:namespace] = namespace
|
||||
end
|
||||
|
||||
Sidekiq.configure_server do |config|
|
||||
@ -18,3 +18,5 @@ end
|
||||
Sidekiq.configure_client do |config|
|
||||
config.redis = redis_params
|
||||
end
|
||||
|
||||
Sidekiq::Logging.logger.level = ::Logger::const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)
|
||||
|
Reference in New Issue
Block a user