diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 18:09:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 18:09:44 +0300 |
commit | 874ead9c3a50de4c4ca4551eaf5b7eb976d26b50 (patch) | |
tree | 637ee9f2da5e251bc08ebf3e972209d51966bf7c /lib/gitlab | |
parent | 2e4c4055181eec9186458dd5dd3219c937032ec7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/application_rate_limiter.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/sidekiq_middleware/duplicate_jobs.rb | 24 | ||||
-rw-r--r-- | lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb | 2 |
3 files changed, 4 insertions, 27 deletions
diff --git a/lib/gitlab/application_rate_limiter.rb b/lib/gitlab/application_rate_limiter.rb index c1066d8fa62..2defbd26b98 100644 --- a/lib/gitlab/application_rate_limiter.rb +++ b/lib/gitlab/application_rate_limiter.rb @@ -19,8 +19,9 @@ module Gitlab # and only do that when it's needed. def rate_limits { - project_export: { threshold: 1, interval: 5.minutes }, - project_download_export: { threshold: 10, interval: 10.minutes }, + issues_create: { threshold: -> { Gitlab::CurrentSettings.current_application_settings.issues_create_limit }, interval: 1.minute }, + project_export: { threshold: 1, interval: 5.minutes }, + project_download_export: { threshold: 10, interval: 10.minutes }, project_repositories_archive: { threshold: 5, interval: 1.minute }, project_generate_new_export: { threshold: 1, interval: 5.minutes }, project_import: { threshold: 30, interval: 5.minutes }, diff --git a/lib/gitlab/sidekiq_middleware/duplicate_jobs.rb b/lib/gitlab/sidekiq_middleware/duplicate_jobs.rb deleted file mode 100644 index 7a77a56d642..00000000000 --- a/lib/gitlab/sidekiq_middleware/duplicate_jobs.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -require 'digest' - -module Gitlab - module SidekiqMiddleware - module DuplicateJobs - DROPPABLE_QUEUES = Set.new([ - Namespaces::RootStatisticsWorker.queue, - Namespaces::ScheduleAggregationWorker.queue - ]).freeze - - def self.drop_duplicates?(queue_name) - Feature.enabled?(:drop_duplicate_sidekiq_jobs) || - drop_duplicates_for_queue?(queue_name) - end - - private_class_method def self.drop_duplicates_for_queue?(queue_name) - DROPPABLE_QUEUES.include?(queue_name) && - Feature.enabled?(:drop_duplicate_sidekiq_jobs_for_queue) - end - end - end -end diff --git a/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb b/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb index a9007039334..79bbb99752e 100644 --- a/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb +++ b/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb @@ -67,7 +67,7 @@ module Gitlab end def droppable? - idempotent? && duplicate? && DuplicateJobs.drop_duplicates?(queue_name) + idempotent? && duplicate? end private |