diff options
author | Naoki Kosaka <n.k@mail.yukimochi.net> | 2017-11-08 23:19:22 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-11-08 15:19:22 +0100 |
commit | 4c0a85ef9bbb01f28e0ed776df5c989c87428edd (patch) | |
tree | be67898acda456c134313bbe72a328c906282c12 | |
parent | 64cc129225566deb605738cec5f787dcd7dca5fc (diff) |
In remove_remote, exclude removed media attachments. (#5626)
-rw-r--r-- | lib/tasks/mastodon.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index 5614ddf48..4d519bf90 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -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 |