diff options
author | Valery Sizov <valery@gitlab.com> | 2018-09-14 17:27:31 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2018-09-24 18:41:14 +0300 |
commit | 2daa8d387bd4dd87f872d0f195d25e67cd199777 (patch) | |
tree | de4a8d3bbdd4f337957aba9555a67e34d2fb5f2a /app | |
parent | 4007456808a9d18858b2c117b9cc6fee91d26ed6 (diff) | |
download | gitlab-ce-2daa8d387bd4dd87f872d0f195d25e67cd199777.tar.gz |
Remove background job throttling feature51509-remove-sidekiq-limit-fetch
We remove this feature as it never worked properly
Diffstat (limited to 'app')
5 files changed, 1 insertions, 68 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 875e46969fe..b7c758a42ed 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -128,8 +128,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController disabled_oauth_sign_in_sources: [], import_sources: [], repository_storages: [], - restricted_visibility_levels: [], - sidekiq_throttling_queues: [] + restricted_visibility_levels: [] ] end end diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index dc393968786..c9a5431d18e 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -108,10 +108,6 @@ module ApplicationSettingsHelper options_for_select(options, selected) end - def sidekiq_queue_options_for_select - options_for_select(Sidekiq::Queue.all.map(&:name), @application_setting.sidekiq_throttling_queues) - end - def circuitbreaker_failure_count_help_text health_link = link_to(s_('AdminHealthPageLink|health page'), admin_health_check_path) api_link = link_to(s_('CircuitBreakerApiLink|circuitbreaker api'), help_page_path("api/repository_storage_health")) @@ -234,9 +230,6 @@ module ApplicationSettingsHelper :session_expire_delay, :shared_runners_enabled, :shared_runners_text, - :sidekiq_throttling_enabled, - :sidekiq_throttling_factor, - :sidekiq_throttling_queues, :sign_in_text, :signup_enabled, :terminal_max_session_time, diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 645adddb000..5f835a8da75 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -26,7 +26,6 @@ class ApplicationSetting < ActiveRecord::Base serialize :domain_whitelist, Array # rubocop:disable Cop/ActiveRecordSerialize serialize :domain_blacklist, Array # rubocop:disable Cop/ActiveRecordSerialize serialize :repository_storages # rubocop:disable Cop/ActiveRecordSerialize - serialize :sidekiq_throttling_queues, Array # rubocop:disable Cop/ActiveRecordSerialize cache_markdown_field :sign_in_text cache_markdown_field :help_page_text @@ -131,15 +130,6 @@ class ApplicationSetting < ActiveRecord::Base presence: { message: 'Domain blacklist cannot be empty if Blacklist is enabled.' }, if: :domain_blacklist_enabled? - validates :sidekiq_throttling_factor, - numericality: { greater_than: 0, less_than: 1 }, - presence: { message: 'Throttling factor cannot be empty if Sidekiq Throttling is enabled.' }, - if: :sidekiq_throttling_enabled? - - validates :sidekiq_throttling_queues, - presence: { message: 'Queues to throttle cannot be empty if Sidekiq Throttling is enabled.' }, - if: :sidekiq_throttling_enabled? - validates :housekeeping_incremental_repack_period, presence: true, numericality: { only_integer: true, greater_than: 0 } @@ -282,7 +272,6 @@ class ApplicationSetting < ActiveRecord::Base send_user_confirmation_email: false, shared_runners_enabled: Settings.gitlab_ci['shared_runners_enabled'], shared_runners_text: nil, - sidekiq_throttling_enabled: false, sign_in_text: nil, signup_enabled: Settings.gitlab['signup_enabled'], terminal_max_session_time: 0, @@ -328,10 +317,6 @@ class ApplicationSetting < ActiveRecord::Base ::Gitlab::Database.cached_column_exists?(:application_settings, :help_page_support_url) end - def sidekiq_throttling_column_exists? - ::Gitlab::Database.cached_column_exists?(:application_settings, :sidekiq_throttling_enabled) - end - def disabled_oauth_sign_in_sources=(sources) sources = (sources || []).map(&:to_s) & Devise.omniauth_providers.map(&:to_s) super(sources) @@ -411,12 +396,6 @@ class ApplicationSetting < ActiveRecord::Base ensure_health_check_access_token! end - def sidekiq_throttling_enabled? - return false unless sidekiq_throttling_column_exists? - - sidekiq_throttling_enabled - end - def usage_ping_can_be_configured? Settings.gitlab.usage_ping_enabled end diff --git a/app/views/admin/application_settings/_background_jobs.html.haml b/app/views/admin/application_settings/_background_jobs.html.haml deleted file mode 100644 index 7d1a64b645a..00000000000 --- a/app/views/admin/application_settings/_background_jobs.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-background-settings'), html: { class: 'fieldset-form' } do |f| - = form_errors(@application_setting) - - %fieldset - %p - These settings require a - = link_to 'restart', help_page_path('administration/restart_gitlab') - to take effect. - .form-group - .form-check - = f.check_box :sidekiq_throttling_enabled, class: 'form-check-input' - = f.label :sidekiq_throttling_enabled, class: 'form-check-label' do - Enable Sidekiq Job Throttling - .form-text.text-muted - Limit the amount of resources slow running jobs are assigned. - .form-group - = f.label :sidekiq_throttling_queues, 'Sidekiq queues to throttle', class: 'label-bold' - = f.select :sidekiq_throttling_queues, sidekiq_queue_options_for_select, { include_hidden: false }, multiple: true, class: 'select2 select-wide', data: { field: 'sidekiq_throttling_queues' } - .form-text.text-muted - Choose which queues you wish to throttle. - .form-group - = f.label :sidekiq_throttling_factor, 'Throttling Factor', class: 'label-bold' - = f.number_field :sidekiq_throttling_factor, class: 'form-control', min: '0.01', max: '0.99', step: '0.01' - .form-text.text-muted - The factor by which the queues should be throttled. A value between 0.0 and 1.0, exclusive. - - = f.submit 'Save changes', class: "btn btn-success" diff --git a/app/views/admin/application_settings/preferences.html.haml b/app/views/admin/application_settings/preferences.html.haml index 75f76eea3b4..00000b86ab7 100644 --- a/app/views/admin/application_settings/preferences.html.haml +++ b/app/views/admin/application_settings/preferences.html.haml @@ -46,17 +46,6 @@ .settings-content = render 'realtime' -%section.settings.as-background.no-animate#js-background-settings{ class: ('expanded' if expanded_by_default?) } - .settings-header - %h4 - = _('Background jobs') - %button.btn.btn-default.js-settings-toggle{ type: 'button' } - = expanded_by_default? ? _('Collapse') : _('Expand') - %p - = _('Configure Sidekiq job throttling.') - .settings-content - = render 'background_jobs' - %section.settings.as-gitaly.no-animate#js-gitaly-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 |