about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/tasks/mastodon.rake7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index a8fb58b7f..4761b2919 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -75,6 +75,13 @@ namespace :mastodon do
     end
   end
 
+  namespace :users do
+    desc 'clear unconfirmed users'
+    task clear: :environment do
+      User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).find_each(&:destroy)
+    end
+  end
+
   namespace :maintenance do
     desc 'Update counter caches'
     task update_counter_caches: :environment do