mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:05:24 +08:00
Merge pull request #1420 from ZogStriP/rake-task-to-regenerate-avatars
rake task to regenerate avatars
This commit is contained in:
commit
d00e0cb96a
|
@ -669,7 +669,7 @@ en:
|
||||||
username_change_period: "The number of days after registration that accounts can change their username."
|
username_change_period: "The number of days after registration that accounts can change their username."
|
||||||
|
|
||||||
allow_uploaded_avatars: "Allow users to upload their custom avatars"
|
allow_uploaded_avatars: "Allow users to upload their custom avatars"
|
||||||
allow_animated_avatars: "Allow users to use animated gif for avatars"
|
allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:regenerate rake task after changing that setting."
|
||||||
default_digest_email_frequency: "How often users receive digest emails by default. They can change this setting in their preferences."
|
default_digest_email_frequency: "How often users receive digest emails by default. They can change this setting in their preferences."
|
||||||
|
|
||||||
notification_types:
|
notification_types:
|
||||||
|
|
13
lib/tasks/avatars.rake
Normal file
13
lib/tasks/avatars.rake
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
desc "re-generate avatars"
|
||||||
|
task "avatars:regenerate" => :environment do
|
||||||
|
RailsMultisite::ConnectionManagement.each_connection do |db|
|
||||||
|
puts "Generating avatars for: #{db}"
|
||||||
|
|
||||||
|
User.select(:uploaded_avatar_id).where("uploaded_avatar_id IS NOT NULL").all.each do |u|
|
||||||
|
Jobs.enqueue(:generate_avatars, upload_id: u.uploaded_avatar_id)
|
||||||
|
putc "."
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
puts "\ndone."
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user