Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2019-04-30 15:05:54 +0300
committerNick Thomas <nick@gitlab.com>2019-04-30 15:05:54 +0300
commitac744fd4fceb996dcafe7958dd35b081331f46fe (patch)
treeeba5a21f6e074b2c83141dda4999034b3b7aec93 /app/workers/pages_domain_removal_cron_worker.rb
parent9e2958aed9fb634801d57acd2bd6f4500dec012e (diff)
Remove disabled pages domains
Domain will be removed by verification worker after 1 week of being disabled
Diffstat (limited to 'app/workers/pages_domain_removal_cron_worker.rb')
-rw-r--r--app/workers/pages_domain_removal_cron_worker.rb16
1 files changed, 16 insertions, 0 deletions
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