mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
parent
64f2ada5d4
commit
ecd36c1ede
@ -476,8 +476,10 @@ namespace :mastodon do
|
||||
time_ago = ENV.fetch('NUM_DAYS') { 7 }.to_i.days.ago
|
||||
|
||||
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
|
||||
if media.file.exists?
|
||||
media.file.destroy
|
||||
media.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user