Skip to content
Snippets Groups Projects
Commit 4c0a85ef authored by Naoki Kosaka's avatar Naoki Kosaka Committed by Eugen Rochko
Browse files

In remove_remote, exclude removed media attachments. (#5626)

parent 64cc1292
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ namespace :mastodon do
task remove_remote: :environment do
time_ago = ENV.fetch('NUM_DAYS') { 7 }.to_i.days.ago
MediaAttachment.where.not(remote_url: '').where('created_at < ?', time_ago).find_each do |media|
MediaAttachment.where.not(remote_url: '').where.not(file_file_name: nil).where('created_at < ?', time_ago).find_each do |media|
media.file.destroy
media.save
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment