Skip to content

Commit 2be9e33

Browse files
author
Reem Ibrahim
committed
further update to prevent empty errors pages for unfinished tasks
1 parent 3cc5932 commit 2be9e33

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

app/jobs/cleanup_submission_entries_job.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ def perform(dry_run: false, max_run_time: 5.hours, task_batch_size: 100, entries
1313
tasks_with_unprocessed_submissions.find_in_batches(batch_size: task_batch_size) do |tasks_batch|
1414
tasks_batch.each do |task|
1515
active_id = task.active_submission&.id
16+
latest_id = task.latest_submission&.id
1617

1718
failed_submissions = task.submissions
1819
.where(aasm_state: 'validation_failed', cleanup_processed: false)
1920
.where.not(id: active_id)
21+
.where.not(id: latest_id)
2022

2123
next if failed_submissions.empty?
2224

0 commit comments

Comments
 (0)