do not retry

This commit is contained in:
Pete Matsyburka
2025-12-23 10:01:09 +02:00
parent 1984d4ec8d
commit 1cf9cc18f1
3 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -17,6 +17,7 @@ module Submissions
raise NotCompletedYet unless submission.submitters.all?(&:completed_at?)
total_wait_time ||= 0
key = [KEY_PREFIX, submission.id].join(':')
if ApplicationRecord.uncached { LockEvent.exists?(key:, event_name: :complete) }
@@ -39,7 +40,9 @@ module Submissions
rescue ActiveRecord::RecordNotUnique
sleep WAIT_FOR_RETRY
retry
total_wait_time += WAIT_FOR_RETRY
total_wait_time > CHECK_COMPLETE_TIMEOUT ? raise : retry
rescue StandardError => e
Rollbar.error(e) if defined?(Rollbar)
Rails.logger.error(e)
+3 -1
View File
@@ -17,6 +17,7 @@ module Submissions
raise NotCompletedYet unless submitter.completed_at?
total_wait_time ||= 0
key = [KEY_PREFIX, submitter.id].join(':')
if ApplicationRecord.uncached { LockEvent.exists?(key:, event_name: :complete) }
@@ -38,8 +39,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)
+3 -1
View File
@@ -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)