Fix #4544: Show limited view of other user's uploads on the upload index.

* Show completed uploads to other users.
* Don't show failed or incomplete uploads to other users.
* Don't show tags to other users.
* Delete completed uploads after 1 hour.
* Delete incomplete uploads after 1 day.
* Delete failed uploads after 3 days.
This commit is contained in:
evazion
2020-07-13 18:58:40 -05:00
parent 85f464df83
commit ed79b623cc
6 changed files with 31 additions and 13 deletions

View File

@@ -947,8 +947,9 @@ class UploadServiceTest < ActiveSupport::TestCase
should "delete stale upload records" do
@upload = as(@user) { UploadService.new(file: upload_file("test/files/test.jpg")).start! }
@upload.update!(created_at: 1.month.ago)
assert_difference("Upload.count", -1) { Upload.prune!(0.seconds.ago) }
assert_difference("Upload.count", -1) { Upload.prune! }
end
should "delete unused files after deleting the upload" do