about summary refs log tree commit diff
path: root/app/workers/scheduler
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-03 23:25:37 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-03 23:25:37 -0500
commit4801d5ac847f67681a633d041cfa639780c4f12b (patch)
tree269afa926f261a4f003f5613800bf9b7bfa85807 /app/workers/scheduler
parent0a646efd48d48836261ab553e47d2a46dde28a98 (diff)
move `Scheduler::JanitorScheduler::admin_account` to `ModerationHelper::janitor_account`
Diffstat (limited to 'app/workers/scheduler')
-rw-r--r--app/workers/scheduler/janitor_scheduler.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/workers/scheduler/janitor_scheduler.rb b/app/workers/scheduler/janitor_scheduler.rb
index c01cb8b4e..05d62605e 100644
--- a/app/workers/scheduler/janitor_scheduler.rb
+++ b/app/workers/scheduler/janitor_scheduler.rb
@@ -10,7 +10,7 @@ class Scheduler::JanitorScheduler
   sidekiq_options unique: :until_executed, retry: 0
 
   def perform
-    @account = admin_account
+    @account = janitor_account
     return if @account.nil?
 
     @exclude_ids = excluded_account_ids
@@ -63,13 +63,6 @@ class Scheduler::JanitorScheduler
   end
 
 
-
-  def admin_account
-    account_id = ENV.fetch('JANITOR_USER', '').to_i
-    return if account_id == 0
-    Account.find_by(id: account_id)
-  end
-
   def spammer_accounts
     spammer_ids = spammer_account_ids
     Account.reorder(nil).where(id: spammer_ids, suspended_at: nil)