diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backup/repository.rb | 38 | ||||
-rw-r--r-- | lib/gitlab/experimentation.rb | 3 |
2 files changed, 26 insertions, 15 deletions
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb index 1daa29f00ef..33fa36e6497 100644 --- a/lib/backup/repository.rb +++ b/lib/backup/repository.rb @@ -26,13 +26,17 @@ module Backup threads = Gitlab.config.repositories.storages.keys.map do |storage| Thread.new do - dump_storage(storage, semaphore, max_storage_concurrency: max_storage_concurrency) - rescue => e - errors << e + Rails.application.executor.wrap do + dump_storage(storage, semaphore, max_storage_concurrency: max_storage_concurrency) + rescue => e + errors << e + end end end - threads.each(&:join) + ActiveSupport::Dependencies.interlock.permit_concurrent_loads do + threads.each(&:join) + end raise errors.pop unless errors.empty? end @@ -155,16 +159,18 @@ module Backup threads = Array.new(max_storage_concurrency) do Thread.new do - while project = queue.pop - semaphore.acquire - - begin - dump_project(project) - rescue => e - errors << e - break - ensure - semaphore.release + Rails.application.executor.wrap do + while project = queue.pop + semaphore.acquire + + begin + dump_project(project) + rescue => e + errors << e + break + ensure + semaphore.release + end end end end @@ -177,7 +183,9 @@ module Backup end queue.close - threads.each(&:join) + ActiveSupport::Dependencies.interlock.permit_concurrent_loads do + threads.each(&:join) + end raise errors.pop unless errors.empty? end diff --git a/lib/gitlab/experimentation.rb b/lib/gitlab/experimentation.rb index 47be22f35ec..0936cc17578 100644 --- a/lib/gitlab/experimentation.rb +++ b/lib/gitlab/experimentation.rb @@ -62,6 +62,9 @@ module Gitlab }, customize_homepage: { tracking_category: 'Growth::Expansion::Experiment::CustomizeHomepage' + }, + invite_email: { + tracking_category: 'Growth::Acquisition::Experiment::InviteEmail' } }.freeze |