mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
e732aa8a86
Highly recommended to run: `RAILS_ENV=production bundle exec rake avatars:regenerate` to fix the avatar templates stored in the database.
12 lines
429 B
Ruby
12 lines
429 B
Ruby
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|
|
|
Jobs.enqueue(:generate_avatars, upload_id: u.uploaded_avatar_id, user_id: u.id)
|
|
putc "."
|
|
end
|
|
end
|
|
puts "\ndone."
|
|
end
|