about summary refs log tree commit diff
path: root/app/workers/scheduler/user_cleanup_scheduler.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-19 15:48:29 +0200
committerGitHub <noreply@github.com>2018-08-19 15:48:29 +0200
commit91c929a42cbb71b47af976ec021f4be235b9f3fe (patch)
treee71f95bac1fcc8b3806bdba7fd0348a56776e3e5 /app/workers/scheduler/user_cleanup_scheduler.rb
parent59c68c1a74d5398b9c31489744ff8eca82e2ce50 (diff)
Keep scheduler jobs unique until they're done (#8287)
Diffstat (limited to 'app/workers/scheduler/user_cleanup_scheduler.rb')
-rw-r--r--app/workers/scheduler/user_cleanup_scheduler.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/workers/scheduler/user_cleanup_scheduler.rb b/app/workers/scheduler/user_cleanup_scheduler.rb
index 245536cea..dde195bff 100644
--- a/app/workers/scheduler/user_cleanup_scheduler.rb
+++ b/app/workers/scheduler/user_cleanup_scheduler.rb
@@ -3,6 +3,8 @@
 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|
       Account.where(id: batch.map(&:account_id)).delete_all