diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 15:10:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 15:10:53 +0300 |
commit | ff579119e2ecf2608370a1f24c4d791d28f269d9 (patch) | |
tree | 6f510ae943600102faf9dbc54df0f3e7f96c3417 /app/workers/pages_transfer_worker.rb | |
parent | 2c49951e8c1f4fb95d15cac3dd0677d6882d2add (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/pages_transfer_worker.rb')
-rw-r--r-- | app/workers/pages_transfer_worker.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/workers/pages_transfer_worker.rb b/app/workers/pages_transfer_worker.rb new file mode 100644 index 00000000000..f78564cc69d --- /dev/null +++ b/app/workers/pages_transfer_worker.rb @@ -0,0 +1,20 @@ +# 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) + return unless Gitlab::PagesTransfer::Async::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 |