2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
class PagesDomainRemovalCronWorker # rubocop:disable Scalability/IdempotentWorker
|
2019-07-31 22:56:46 +05:30
|
|
|
include ApplicationWorker
|
|
|
|
include CronjobQueue
|
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
feature_category :pages
|
2019-12-26 22:10:19 +05:30
|
|
|
worker_resource_boundary :cpu
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2019-07-31 22:56:46 +05:30
|
|
|
def perform
|
2020-03-13 15:44:24 +05:30
|
|
|
PagesDomain.for_removal.with_logging_info.find_each do |domain|
|
|
|
|
with_context(project: domain.project) { domain.destroy! }
|
2019-07-31 22:56:46 +05:30
|
|
|
rescue => e
|
2020-01-01 13:55:28 +05:30
|
|
|
Gitlab::ErrorTracking.track_exception(e)
|
2019-07-31 22:56:46 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|