Class: Projects::HashedStorage::RollbackAttachmentsService
- Inherits:
-
BaseAttachmentService
- Object
- BaseService
- BaseAttachmentService
- Projects::HashedStorage::RollbackAttachmentsService
- Defined in:
- app/services/projects/hashed_storage/rollback_attachments_service.rb
Instance Attribute Summary
Attributes inherited from BaseAttachmentService
#logger, #new_disk_path, #old_disk_path
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
Methods inherited from BaseAttachmentService
#initialize, #skipped?, #target_path_discardable?
Methods inherited from BaseService
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
This class inherits a constructor from Projects::HashedStorage::BaseAttachmentService
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/projects/hashed_storage/rollback_attachments_service.rb', line 6 def execute origin = FileUploader.absolute_base_dir(project) project.storage_version = ::Project::HASHED_STORAGE_FEATURES[:repository] target = FileUploader.absolute_base_dir(project) @new_disk_path = FileUploader.base_dir(project) result = move_folder!(origin, target) if result project.save!(validate: false) yield if block_given? else # Rollback changes project.rollback! end result end |