2020-08-26 08:10:53 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class PagesTransferWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
|
|
|
TransferFailedError = Class.new(StandardError)
|
|
|
|
|
|
|
|
feature_category :pages
|
|
|
|
loggable_arguments 0, 1
|
|
|
|
|
|
|
|
def perform(method, args)
|
2021-02-16 13:09:24 -05:00
|
|
|
return unless Gitlab::PagesTransfer::METHODS.include?(method)
|
2020-08-26 08:10:53 -04:00
|
|
|
|
|
|
|
result = Gitlab::PagesTransfer.new.public_send(method, *args) # rubocop:disable GitlabSecurity/PublicSend
|
|
|
|
|
|
|
|
# If result isn't truthy, the move failed. Promote this to an
|
|
|
|
# exception so that it will be logged and retried appropriately
|
|
|
|
raise TransferFailedError unless result
|
|
|
|
end
|
|
|
|
end
|