From 13e46470f2934e82a170e878db63350cae1f5a57 Mon Sep 17 00:00:00 2001 From: AndrewWood94 Date: Thu, 30 May 2024 17:18:43 +0100 Subject: [PATCH] Destroy existing sample_persistence_task if re-extracting --- app/controllers/data_files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/data_files_controller.rb b/app/controllers/data_files_controller.rb index 0d0b66e81f..6143dfcee1 100644 --- a/app/controllers/data_files_controller.rb +++ b/app/controllers/data_files_controller.rb @@ -169,7 +169,7 @@ def extract_samples SampleDataPersistJob.new(@data_file, @sample_type, User.current_user, assay_ids: params["assay_ids"]).queue_job flash[:notice] = 'Started creating extracted samples' else - @data_file.sample_persistence_task.update(status: "cancelled") if @data_file.sample_persistence_task&.success? + @data_file.sample_persistence_task.destroy if @data_file.sample_persistence_task&.success? SampleDataExtractionJob.new(@data_file, @sample_type).queue_job end