2019-04-30 12:05:54 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class PagesDomainRemovalCronWorker # rubocop:disable Scalability/IdempotentWorker
|
2019-04-30 12:05:54 +00:00
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
|
|
|
|
2020-02-11 18:08:58 +00:00
|
|
|
include CronjobQueue
|
2019-04-30 12:05:54 +00:00
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :pages
|
2019-10-30 15:14:17 +00:00
|
|
|
worker_resource_boundary :cpu
|
2019-10-18 11:11:44 +00:00
|
|
|
|
2019-04-30 12:05:54 +00:00
|
|
|
def perform
|
2020-02-11 18:08:58 +00:00
|
|
|
PagesDomain.for_removal.with_logging_info.find_each do |domain|
|
|
|
|
with_context(project: domain.project) { domain.destroy! }
|
2021-04-26 12:09:44 +00:00
|
|
|
rescue StandardError => e
|
2019-12-16 12:07:43 +00:00
|
|
|
Gitlab::ErrorTracking.track_exception(e)
|
2019-04-30 12:05:54 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|