about summary refs log tree commit diff
diff options
context:
space:
mode:
authord0p1 <dopi-sama@hush.com>2017-04-11 22:51:17 +0200
committerEugen <eugen@zeonfederated.com>2017-04-11 22:51:17 +0200
commit2f2b84bfbbfa21a09e03dca05e159aadb70d2232 (patch)
tree5383013c66c5f5b6f69d7b72cbff9fca6dc72020
parent5cdd2c2414592f50005fa1dd73b80e332fb73cb7 (diff)
Add task in order to delete unconfirmed users (older than 2days) (#1571)
* add task in order to delete unconfirmed user

* change 7 days to 2
-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