Skip to content
Extraits de code Groupes Projets
Valider 8f7e3d37 rédigé par mayaeh's avatar mayaeh Validation de Eugen Rochko
Parcourir les fichiers

Fix "tootctl media remove" can't count the file size (#9288)

* Fixed an issue where "tootctl media remove" can not count the file size.

* Fixed the problem pointed out by codeclimate.
parent 560acf17
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -50,10 +50,10 @@ module Mastodon ...@@ -50,10 +50,10 @@ module Mastodon
else else
MediaAttachment.where.not(remote_url: '').where.not(file_file_name: nil).where('created_at < ?', time_ago).reorder(nil).find_in_batches do |media_attachments| MediaAttachment.where.not(remote_url: '').where.not(file_file_name: nil).where('created_at < ?', time_ago).reorder(nil).find_in_batches do |media_attachments|
media_attachments.each do |m| media_attachments.each do |m|
size += m.file_file_size || 0
Maintenance::UncacheMediaWorker.new.perform(m) unless options[:dry_run] Maintenance::UncacheMediaWorker.new.perform(m) unless options[:dry_run]
options[:verbose] ? say(m.id) : say('.', :green, false) options[:verbose] ? say(m.id) : say('.', :green, false)
processed += 1 processed += 1
size += m.file_file_size || 0
end end
end end
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter