diff options
Diffstat (limited to 'lib/backup/repositories.rb')
-rw-r--r-- | lib/backup/repositories.rb | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/backup/repositories.rb b/lib/backup/repositories.rb index 4c39e58c87d..e7c3e869928 100644 --- a/lib/backup/repositories.rb +++ b/lib/backup/repositories.rb @@ -4,12 +4,14 @@ require 'yaml' module Backup class Repositories - def initialize(progress, strategy:) + def initialize(progress, strategy:, max_concurrency: 1, max_storage_concurrency: 1) @progress = progress @strategy = strategy + @max_concurrency = max_concurrency + @max_storage_concurrency = max_storage_concurrency end - def dump(max_concurrency:, max_storage_concurrency:) + def dump strategy.start(:create) # gitaly-backup is designed to handle concurrency on its own. So we want @@ -19,6 +21,11 @@ module Backup return enqueue_consecutive end + if max_concurrency < 1 || max_storage_concurrency < 1 + puts "GITLAB_BACKUP_MAX_CONCURRENCY and GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY must have a value of at least 1".color(:red) + exit 1 + end + check_valid_storages! semaphore = Concurrent::Semaphore.new(max_concurrency) @@ -54,9 +61,17 @@ module Backup restore_object_pools end + def enabled + true + end + + def human_name + _('repositories') + end + private - attr_reader :progress, :strategy + attr_reader :progress, :strategy, :max_concurrency, :max_storage_concurrency def check_valid_storages! repository_storage_klasses.each do |klass| |