Class: Backup::Targets::Repositories
- Extended by:
- Gitlab::Utils::Override
- Defined in:
- lib/backup/targets/repositories.rb
Overview
Backup and restores repositories by querying the database
Instance Attribute Summary
Attributes inherited from Target
Instance Method Summary collapse
- #asynchronous? ⇒ Boolean
- #dump(destination_path, backup_id) ⇒ Object
-
#initialize(progress, strategy:, options:, storages: [], paths: [], skip_paths: []) ⇒ Repositories
constructor
A new instance of Repositories.
- #restore(destination_path, backup_id) ⇒ Object
Methods included from Gitlab::Utils::Override
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Constructor Details
#initialize(progress, strategy:, options:, storages: [], paths: [], skip_paths: []) ⇒ Repositories
Returns a new instance of Repositories.
16 17 18 19 20 21 22 23 24 |
# File 'lib/backup/targets/repositories.rb', line 16 def initialize(progress, strategy:, options:, storages: [], paths: [], skip_paths: []) super(progress, options: ) @strategy = strategy @storages = storages @paths = paths @skip_paths = skip_paths @logger = Gitlab::BackupLogger.new(progress) end |
Instance Method Details
#asynchronous? ⇒ Boolean
56 57 58 |
# File 'lib/backup/targets/repositories.rb', line 56 def asynchronous? false end |
#dump(destination_path, backup_id) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/backup/targets/repositories.rb', line 28 def dump(destination_path, backup_id) strategy.start(:create, destination_path, backup_id: backup_id) enqueue_consecutive ensure strategy.finish! end |
#restore(destination_path, backup_id) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/backup/targets/repositories.rb', line 38 def restore(destination_path, backup_id) strategy.start(:restore, destination_path, remove_all_repositories: remove_all_repositories, backup_id: backup_id) enqueue_consecutive ensure begin strategy.finish! rescue Error => e logger.error(e.) end restore_object_pools end |