|
|
|
|
@ -16,6 +16,7 @@ module Submissions
|
|
|
|
|
|
|
|
|
|
raise NotCompletedYet unless submitter.completed_at?
|
|
|
|
|
|
|
|
|
|
total_wait_time ||= 0
|
|
|
|
|
key = ['result_attachments', submitter.id].join(':')
|
|
|
|
|
|
|
|
|
|
return submitter.documents if ApplicationRecord.uncached { LockEvent.exists?(key:, event_name: :complete) }
|
|
|
|
|
@ -35,8 +36,9 @@ module Submissions
|
|
|
|
|
end
|
|
|
|
|
rescue ActiveRecord::RecordNotUnique
|
|
|
|
|
sleep WAIT_FOR_RETRY
|
|
|
|
|
total_wait_time += WAIT_FOR_RETRY
|
|
|
|
|
|
|
|
|
|
retry
|
|
|
|
|
total_wait_time > CHECK_COMPLETE_TIMEOUT ? raise : retry
|
|
|
|
|
rescue StandardError => e
|
|
|
|
|
Rollbar.error(e) if defined?(Rollbar)
|
|
|
|
|
Rails.logger.error(e)
|
|
|
|
|
|