Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Fix "tootctl media remove" can't count the file size (mastodon#9288)
Browse files Browse the repository at this point in the history
* Fixed an issue where "tootctl media remove" can not count the file size.

* Fixed the problem pointed out by codeclimate.
  • Loading branch information
mayaeh authored and Gargron committed Nov 16, 2018
1 parent 560acf1 commit 8f7e3d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mastodon/media_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def remove
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|
media_attachments.each do |m|
size += m.file_file_size || 0
Maintenance::UncacheMediaWorker.new.perform(m) unless options[:dry_run]
options[:verbose] ? say(m.id) : say('.', :green, false)
processed += 1
size += m.file_file_size || 0
end
end
end
Expand Down

0 comments on commit 8f7e3d3

Please sign in to comment.