diff options
author | Sean McGivern <sean@gitlab.com> | 2017-08-21 14:50:09 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-08-21 14:56:22 +0300 |
commit | 0db5f576fedfa5c4b2a1f9f01a0fdc4cbcd759f9 (patch) | |
tree | 6cf86500e7a2ef947d68bb199aec49ec5de5820f /lib | |
parent | fa293df2b7f3f63b72640dbc5e70b539cbd106b1 (diff) |
Only require sidekiq-limit_fetch when enabled in settings
This gem allows Sidekiq jobs to be throttled. Unfortunately, it has a
side-effect: when we haven't enabled job throttling, it will still hit Redis a
lot (and miss, because nothing is configured).
As this setting already required a restart, ensure that the library is only
required when it's enabled.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/sidekiq_throttler.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/sidekiq_throttler.rb b/lib/gitlab/sidekiq_throttler.rb index d4d39a888e7..5512afa45a8 100644 --- a/lib/gitlab/sidekiq_throttler.rb +++ b/lib/gitlab/sidekiq_throttler.rb @@ -3,6 +3,8 @@ module Gitlab class << self def execute! if Gitlab::CurrentSettings.sidekiq_throttling_enabled? + require 'sidekiq-limit_fetch' + Gitlab::CurrentSettings.current_application_settings.sidekiq_throttling_queues.each do |queue| Sidekiq::Queue[queue].limit = queue_limit end |