Browse Source

Fix dependencies at boot time (#359)

pull/361/head
Stéphane Meny 3 years ago committed by GitHub
parent
commit
a81c02a524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      config/initializers/rack_attack.rb

4
config/initializers/rack_attack.rb

@ -1,8 +1,10 @@
require "paas_configuration_service"
if Rails.env.development? || Rails.env.test? if Rails.env.development? || Rails.env.test?
Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new
Rack::Attack.enabled = false Rack::Attack.enabled = false
else else
redis_url = PaasConfigurationService.new.redis_uris[:"dluhc-core-#{Redis.env}-redis-rate-limit"] redis_url = PaasConfigurationService.new.redis_uris[:"dluhc-core-#{Rails.env}-redis-rate-limit"]
Rack::Attack.cache.store = ActiveSupport::Cache::RedisCacheStore.new(url: redis_url) Rack::Attack.cache.store = ActiveSupport::Cache::RedisCacheStore.new(url: redis_url)
end end

Loading…
Cancel
Save