diff --git a/python/lib/dcm2bids_imaging_pipeline_lib/push_imaging_files_to_s3_pipeline.py b/python/lib/dcm2bids_imaging_pipeline_lib/push_imaging_files_to_s3_pipeline.py index 56dda107b..82e47b30f 100644 --- a/python/lib/dcm2bids_imaging_pipeline_lib/push_imaging_files_to_s3_pipeline.py +++ b/python/lib/dcm2bids_imaging_pipeline_lib/push_imaging_files_to_s3_pipeline.py @@ -95,6 +95,9 @@ def _get_list_of_files_from_files(self): file_entries = self.imaging_obj.files_db_obj.get_files_inserted_for_tarchive_id(self.tarchive_id) for file in file_entries: + if file['File'].startswith('s3://'): + # skip since file already pushed to S3 + continue self.files_to_push_list.append({ "table_name": "files", "id_field_name": "FileID", @@ -146,6 +149,9 @@ def _get_list_of_files_from_mri_protocol_violated_scans(self): if not os.path.exists(entry['minc_location']): # violation has been rerun or moved continue + if entry['minc_location'].startswith('s3://'): + # skip since file already pushed to S3 + continue self.files_to_push_list.append({ "table_name": "mri_protocol_violated_scans", "id_field_name": "ID", @@ -174,6 +180,9 @@ def _get_list_of_files_from_mri_violations_log(self): if not os.path.exists(entry['MincFile']): # violation has been rerun or moved continue + if entry['MincFile'].startswith('s3://'): + # skip since file already pushed to S3 + continue self.files_to_push_list.append({ "table_name": "mri_violations_log", "id_field_name": "LogID",