discourse/lib/tasks/avatars.rake

13 lines
429 B
Ruby
Raw Normal View History

2013-09-08 18:22:50 +08:00
desc "re-generate avatars"
task "avatars:regenerate" => :environment do
RailsMultisite::ConnectionManagement.each_connection do |db|
puts "Generating avatars for: #{db}"
next unless SiteSetting.allow_uploaded_avatars
User.where("uploaded_avatar_id IS NOT NULL").find_each do |u|
2013-11-06 19:32:27 +08:00
Jobs.enqueue(:generate_avatars, upload_id: u.uploaded_avatar_id, user_id: u.id)
2013-09-08 18:22:50 +08:00
putc "."
end
end
puts "\ndone."
end