Skip to content
Snippets Groups Projects
Commit ecd36c1e authored by Thomas Leister's avatar Thomas Leister Committed by Eugen Rochko
Browse files

Fixes #6584 (#6585)

parent 64f2ada5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment