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"
|
desc "Run uncompleted account deletions"
|
||||||
task run_account_deletions: :environment do
|
task run_account_deletions: :environment do
|
||||||
if AccountDeletion.uncompleted.count > 0
|
if AccountDeletion.uncompleted.count > 0
|
||||||
puts "Running account deletions.."
|
puts "Running account deletions..."
|
||||||
AccountDeletion.uncompleted.find_each(&:perform!)
|
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."
|
puts "OK."
|
||||||
else
|
else
|
||||||
puts "No acccount deletions to run."
|
puts "No account deletions to run."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue