about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/workers/scheduler/janitor_scheduler.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/workers/scheduler/janitor_scheduler.rb b/app/workers/scheduler/janitor_scheduler.rb
index 05d62605e..4fff07587 100644
--- a/app/workers/scheduler/janitor_scheduler.rb
+++ b/app/workers/scheduler/janitor_scheduler.rb
@@ -22,6 +22,7 @@ class Scheduler::JanitorScheduler
     suspend_spammers!
     silence_markov!
     import_blocklists!
+    export_suspensions!
   end
 
   private
@@ -62,6 +63,15 @@ class Scheduler::JanitorScheduler
     end
   end
 
+  def export_suspensions!
+    outfile = ENV.fetch('JANITOR_BLOCKLIST_OUTPUT', '')
+    return if outfile.blank?
+    return unless File.file?(outfile)
+    File.open(outfile, 'w:UTF-8') do |file|
+      file.puts(DomainBlock.suspend.pluck(:domain))
+    end
+  end
+
 
   def spammer_accounts
     spammer_ids = spammer_account_ids