gitlab-org--gitlab-foss/app/services/projects/hashed_storage_migration_service.rb

23 lines
648 B
Ruby
Raw Normal View History

module Projects
class HashedStorageMigrationService < BaseService
attr_reader :logger
2017-11-15 08:42:38 -05:00
def initialize(project, logger = nil)
@project = project
@logger = logger || Rails.logger
end
def execute
# Migrate repository from Legacy to Hashed Storage
unless project.hashed_storage?(:repository)
return unless HashedStorage::MigrateRepositoryService.new(project, logger).execute
end
2017-11-15 08:42:38 -05:00
# Migrate attachments from Legacy to Hashed Storage
unless project.hashed_storage?(:attachments)
HashedStorage::MigrateAttachmentsService.new(project, logger).execute
end
end
end
end