about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-07-24 16:17:55 +0200
committerGitHub <noreply@github.com>2017-07-24 16:17:55 +0200
commit467456f7a19371fe4d50f25751a1d32a63e9f75c (patch)
tree0baf637b3ede9c70a1a0427eafc245ccdcc2976c /lib
parent2374d63536fd9459243a235763c87f8e9fdfc581 (diff)
Move clean up of unconfirmed users to sidekiq-scheduler (#4336)
* Move clean up of unconfirmed users to sidekiq-scheduler

* mastodon:daily is now deprecated
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/mastodon.rake24
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index edfa3a4ac..226523554 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -1,18 +1,10 @@
 # frozen_string_literal: true
 
 namespace :mastodon do
-  desc 'Execute daily tasks'
+  desc 'Execute daily tasks (deprecated)'
   task :daily do
-    %w(
-      mastodon:feeds:clear
-      mastodon:media:clear
-      mastodon:users:clear
-      mastodon:push:refresh
-    ).each do |task|
-      puts "Starting #{task} at #{Time.now.utc}"
-      Rake::Task[task].invoke
-    end
-    puts "Completed daily tasks at #{Time.now.utc}"
+    # No-op
+    # All of these tasks are now executed via sidekiq-scheduler
   end
 
   desc 'Turn a user into an admin, identified by the USERNAME environment variable'
@@ -162,14 +154,10 @@ namespace :mastodon do
   end
 
   namespace :users do
-    desc 'Clear out unconfirmed users'
+    desc 'Clear out unconfirmed users (deprecated)'
     task clear: :environment do
-      # Users that never confirmed e-mail never signed in, means they
-      # only have a user record and an avatar record, with no files uploaded
-      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
-        User.where(id: batch.map(&:id)).delete_all
-      end
+      # No-op
+      # This task is now executed via sidekiq-scheduler
     end
 
     desc 'List e-mails of all admin users'