replacements: don't delete replaced files.

Don't delete replaced files after 30 days. There are only about 30k
replacements in total, so the cost of keeping replaced files is
negligible. It was also wrong because the media asset wasn't destroyed
too, so there were active media assets with missing files.
This commit is contained in:
evazion
2021-10-24 04:19:25 -05:00
parent d258790199
commit 8d5e0a5b58
6 changed files with 0 additions and 106 deletions

View File

@@ -25,9 +25,6 @@ class PostReplacementsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
travel(PostReplacement::DELETION_GRACE_PERIOD + 1.day)
perform_enqueued_jobs
assert_equal("https://cdn.donmai.us/original/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg", @post.reload.source)
assert_equal("d34e4cf0a437a5d65f8e82b7bcd02606", @post.md5)
assert_equal("d34e4cf0a437a5d65f8e82b7bcd02606", Digest::MD5.file(@post.file(:original)).hexdigest)