mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
In remove_remote, exclude removed media attachments. (#5626)
This commit is contained in:
parent
64cc129225
commit
4c0a85ef9b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user