Use sidekiq_rate_limiter for rate limiting requests to photon.komoot.io

This commit is contained in:
Eugene Burmakin 2024-11-24 15:21:02 +01:00
parent 79bf74add4
commit 559dbbfefa
3 changed files with 6 additions and 0 deletions

View file

@ -27,6 +27,7 @@ gem 'rswag-ui'
gem 'shrine', '~> 3.6'
gem 'sidekiq'
gem 'sidekiq-cron'
gem 'sidekiq-limit_fetch'
gem 'sprockets-rails'
gem 'stimulus-rails'
gem 'tailwindcss-rails'

View file

@ -370,6 +370,8 @@ GEM
fugit (~> 1.8, >= 1.11.1)
globalid (>= 1.0.1)
sidekiq (>= 6.5.0)
sidekiq-limit_fetch (4.4.1)
sidekiq (>= 6)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
@ -465,6 +467,7 @@ DEPENDENCIES
shrine (~> 3.6)
sidekiq
sidekiq-cron
sidekiq-limit_fetch
simplecov
sprockets-rails
stimulus-rails

View file

@ -24,3 +24,5 @@ end
Sidekiq.configure_client do |config|
config.redis = { url: ENV['REDIS_URL'] }
end
Sidekiq::Queue['reverse_geocoding'].limit = 1 if PHOTON_API_HOST == 'photon.komoot.io'