2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
# To make a call happen in a new Sidekiq job, add `.async` before the call. For
|
|
|
|
# instance:
|
|
|
|
#
|
|
|
|
# PagesTransfer.new.async.move_namespace(...)
|
|
|
|
#
|
2017-08-17 22:00:37 +05:30
|
|
|
module Gitlab
|
|
|
|
class PagesTransfer < ProjectTransfer
|
2020-11-24 15:15:51 +05:30
|
|
|
class Async
|
|
|
|
METHODS = %w[move_namespace move_project rename_project rename_namespace].freeze
|
|
|
|
|
|
|
|
METHODS.each do |meth|
|
|
|
|
define_method meth do |*args|
|
|
|
|
PagesTransferWorker.perform_async(meth, args)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def async
|
|
|
|
@async ||= Async.new
|
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def root_dir
|
|
|
|
Gitlab.config.pages.path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|