summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2019-04-30 12:05:54 +0000
committerNick Thomas <nick@gitlab.com>2019-04-30 12:05:54 +0000
commitac744fd4fceb996dcafe7958dd35b081331f46fe (patch)
treeeba5a21f6e074b2c83141dda4999034b3b7aec93 /app/workers
parent9e2958aed9fb634801d57acd2bd6f4500dec012e (diff)
downloadgitlab-ce-ac744fd4fceb996dcafe7958dd35b081331f46fe.tar.gz
Remove disabled pages domains
Domain will be removed by verification worker after 1 week of being disabled
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml1
-rw-r--r--app/workers/pages_domain_removal_cron_worker.rb16
2 files changed, 17 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 7cf2e7100d5..e4e85de93da 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -6,6 +6,7 @@
- cronjob:gitlab_usage_ping
- cronjob:import_export_project_cleanup
- cronjob:pages_domain_verification_cron
+- cronjob:pages_domain_removal_cron
- cronjob:pipeline_schedule
- cronjob:prune_old_events
- cronjob:remove_expired_group_links
diff --git a/app/workers/pages_domain_removal_cron_worker.rb b/app/workers/pages_domain_removal_cron_worker.rb
new file mode 100644
index 00000000000..3aca123e5ac
--- /dev/null
+++ b/app/workers/pages_domain_removal_cron_worker.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class PagesDomainRemovalCronWorker
+ include ApplicationWorker
+ include CronjobQueue
+
+ def perform
+ return unless Feature.enabled?(:remove_disabled_domains)
+
+ PagesDomain.for_removal.find_each do |domain|
+ domain.destroy!
+ rescue => e
+ Raven.capture_exception(e)
+ end
+ end
+end