Class: Projects::HashedStorage::MigrationService
- Inherits:
-
BaseService
- Object
- BaseService
- Projects::HashedStorage::MigrationService
- Defined in:
- app/services/projects/hashed_storage/migration_service.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#old_disk_path ⇒ Object
readonly
Returns the value of attribute old_disk_path.
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, old_disk_path, logger: nil) ⇒ MigrationService
constructor
A new instance of MigrationService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(project, old_disk_path, logger: nil) ⇒ MigrationService
Returns a new instance of MigrationService.
8 9 10 11 12 |
# File 'app/services/projects/hashed_storage/migration_service.rb', line 8 def initialize(project, old_disk_path, logger: nil) @project = project @old_disk_path = old_disk_path @logger = logger || Gitlab::AppLogger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'app/services/projects/hashed_storage/migration_service.rb', line 6 def logger @logger end |
#old_disk_path ⇒ Object (readonly)
Returns the value of attribute old_disk_path.
6 7 8 |
# File 'app/services/projects/hashed_storage/migration_service.rb', line 6 def old_disk_path @old_disk_path end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/projects/hashed_storage/migration_service.rb', line 14 def execute # Migrate repository from Legacy to Hashed Storage unless project.hashed_storage?(:repository) return false unless migrate_repository_service.execute end # Migrate attachments from Legacy to Hashed Storage unless project.hashed_storage?(:attachments) return false unless .execute end true end |