summaryrefslogtreecommitdiff
path: root/app/models/application_setting.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-11-04 16:54:24 -0600
committerPatricio Cano <suprnova32@gmail.com>2016-11-10 11:38:11 -0600
commitb95216aabadb336e4ed8cdc01f69e873f47f10d0 (patch)
treec139f0dc542e178a83a70e2c49ef187099a1606c /app/models/application_setting.rb
parent9e2964c15a7d387e46e25c83afa478c12a856d77 (diff)
downloadgitlab-ce-b95216aabadb336e4ed8cdc01f69e873f47f10d0.tar.gz
Allow the Sidekiq queues to throttle and the factor by which to throttle them to be configurable
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r--app/models/application_setting.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index b728083e91c..075e4f4fc9d 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -19,6 +19,7 @@ class ApplicationSetting < ActiveRecord::Base
serialize :domain_whitelist, Array
serialize :domain_blacklist, Array
serialize :repository_storages
+ serialize :sidekiq_throttling_queues
cache_markdown_field :sign_in_text
cache_markdown_field :help_page_text
@@ -85,6 +86,15 @@ 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 }