debian-mirror-gitlab/app/services/projects/hashed_storage/rollback_service.rb

32 lines
904 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
module Projects
module HashedStorage
class RollbackService < BaseService
attr_reader :logger, :old_disk_path
def execute
# Rollback attachments from Hashed Storage to Legacy
if project.hashed_storage?(:attachments)
2019-12-26 22:10:19 +05:30
return false unless rollback_attachments_service.execute
2019-07-07 11:18:12 +05:30
end
# Rollback repository from Hashed Storage to Legacy
if project.hashed_storage?(:repository)
2019-12-26 22:10:19 +05:30
rollback_repository_service.execute
2019-07-07 11:18:12 +05:30
end
end
private
2019-12-26 22:10:19 +05:30
def rollback_attachments_service
HashedStorage::RollbackAttachmentsService.new(project: project, old_disk_path: old_disk_path, logger: logger)
2019-07-07 11:18:12 +05:30
end
2019-12-26 22:10:19 +05:30
def rollback_repository_service
HashedStorage::RollbackRepositoryService.new(project: project, old_disk_path: old_disk_path, logger: logger)
2019-07-07 11:18:12 +05:30
end
end
end
end