about summary refs log tree commit diff
path: root/app/workers/scheduler/user_cleanup_scheduler.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-21 19:54:21 +0200
committerGitHub <noreply@github.com>2018-08-21 19:54:21 +0200
commit37965ac8d9773ae79f6b8dd6fcd353894d2194ca (patch)
tree51f194442d2ec7ab760b443b98c7685f64481ca7 /app/workers/scheduler/user_cleanup_scheduler.rb
parentc78918162642649ce294d89effbf2e815c2aa327 (diff)
parent8b4abaa90d8dff64525d92c3ba1c750356608240 (diff)
Merge pull request #660 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/workers/scheduler/user_cleanup_scheduler.rb')
-rw-r--r--app/workers/scheduler/user_cleanup_scheduler.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/workers/scheduler/user_cleanup_scheduler.rb b/app/workers/scheduler/user_cleanup_scheduler.rb
index 245536cea..626fb1652 100644
--- a/app/workers/scheduler/user_cleanup_scheduler.rb
+++ b/app/workers/scheduler/user_cleanup_scheduler.rb
@@ -3,8 +3,10 @@
 class Scheduler::UserCleanupScheduler
   include Sidekiq::Worker
 
+  sidekiq_options unique: :until_executed
+
   def perform
-    User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).find_in_batches do |batch|
+    User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).reorder(nil).find_in_batches do |batch|
       Account.where(id: batch.map(&:account_id)).delete_all
       User.where(id: batch.map(&:id)).delete_all
     end