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-17 15:22:39 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-18 15:14:09 -0500
commit32e37245faaa2a29e6c748c5f4401226fb7662c4 (patch)
treee51e9eeba2043afc5b8d9c1124421ff1c2358c09 /app/workers/scheduler
parenta283127dcfcd52e702f0b656b6f0fede25663dae (diff)
janitor - allow retries, `@account_ids -> @exclude_ids`, remove unneeded `uniq` calls
Diffstat (limited to 'app/workers/scheduler')
-rw-r--r--app/workers/scheduler/janitor_scheduler.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/workers/scheduler/janitor_scheduler.rb b/app/workers/scheduler/janitor_scheduler.rb
index 4ebed8fa2..06139a82c 100644
--- a/app/workers/scheduler/janitor_scheduler.rb
+++ b/app/workers/scheduler/janitor_scheduler.rb
@@ -8,15 +8,15 @@ class Scheduler::JanitorScheduler
 
   MIN_POSTS = 6
 
-  sidekiq_options unique: :until_executed, retry: 0
+  sidekiq_options unique: :until_executed
 
   def perform
     @account = janitor_account
     return if @account.nil?
 
-    @exclude_ids = excluded_account_ids.uniq
-    @exclude_domains = excluded_domains.uniq
-    @exclude_markov = excluded_accounts_from_env('MARKOV').uniq
+    @exclude_ids = excluded_account_ids
+    @exclude_domains = excluded_domains
+    @exclude_markov = excluded_accounts_from_env('MARKOV')
 
     prune_deleted_accounts!
     suspend_abandoned_accounts!
@@ -183,7 +183,7 @@ class Scheduler::JanitorScheduler
   end
 
   def domains_from_account_ids
-    Account.reorder(nil).where(id: @account_ids).pluck(:domain).uniq
+    Account.reorder(nil).where(id: @exclude_ids).pluck(:domain).uniq
   end
 
   def local_account_ids
@@ -210,10 +210,10 @@ class Scheduler::JanitorScheduler
 
   def excluded_accounts_from_env(suffix)
     excluded_usernames = ENV.fetch("JANITOR_EXCLUDE_#{suffix.upcase}", '').split
-    Account.reorder(nil).where(username: excluded_usernames).pluck(:id)
+    Account.reorder(nil).where(username: excluded_usernames).pluck(:id).uniq
   end
 
   def excluded_from_env(suffix)
-    ENV.fetch("JANITOR_EXCLUDE_#{suffix.upcase}", '').split
+    ENV.fetch("JANITOR_EXCLUDE_#{suffix.upcase}", '').split.uniq
   end
 end