Add some progress indicators to the account deletions rake task
[ci skip] closes #7646
This commit is contained in:
parent
9673f45ff9
commit
c9423bfdd2
1 changed files with 14 additions and 3 deletions
|
|
@ -63,11 +63,22 @@ namespace :migrations do
|
|||
desc "Run uncompleted account deletions"
|
||||
task run_account_deletions: :environment do
|
||||
if AccountDeletion.uncompleted.count > 0
|
||||
puts "Running account deletions.."
|
||||
AccountDeletion.uncompleted.find_each(&:perform!)
|
||||
puts "Running account deletions..."
|
||||
AccountDeletion.uncompleted.find_each do |account_deletion|
|
||||
print "Deleting #{account_deletion.person.diaspora_handle} ..."
|
||||
progress = Thread.new {
|
||||
loop {
|
||||
sleep 10
|
||||
print "."
|
||||
}
|
||||
}
|
||||
account_deletion.perform!
|
||||
progress.kill
|
||||
puts " Done"
|
||||
end
|
||||
puts "OK."
|
||||
else
|
||||
puts "No acccount deletions to run."
|
||||
puts "No account deletions to run."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue