Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pages_transfer_worker.rb « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c2190a352ddb31b9066745d002168216c1ceaa03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

class PagesTransferWorker # rubocop:disable Scalability/IdempotentWorker
  include ApplicationWorker

  data_consistency :always

  sidekiq_options retry: 3

  TransferFailedError = Class.new(StandardError)

  feature_category :pages
  tags :exclude_from_kubernetes
  loggable_arguments 0, 1

  def perform(method, args)
    return unless Gitlab::PagesTransfer::METHODS.include?(method)

    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