Fix uploads getting stuck in 'processing' state (fix #3659).
Bug: if an upload timed out while downloading the file, Upload#process! would catch the error and attempt to retry, but since the upload was already in the 'processing' state, on the second try `process!` would bail out immediately and leave the upload stuck in the 'processing' state. Fix: remove the retry logic from Upload#process!. Let Downloads::File#download! (which had its own retry logic) handle it instead.
This commit is contained in:
@@ -305,5 +305,15 @@ class UploadTest < ActiveSupport::TestCase
|
||||
assert_nothing_raised {@upload.process!}
|
||||
end
|
||||
end
|
||||
|
||||
context "on timeout errors" do
|
||||
should "leave the upload in an error state" do
|
||||
HTTParty.stubs(:get).raises(Net::ReadTimeout)
|
||||
@upload = FactoryBot.create(:source_upload)
|
||||
@upload.process!
|
||||
|
||||
assert_match(/\Aerror/, @upload.status)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user