Skip to content

Commit

Permalink
do not push files to S3 when their path in the DB is already an S3 URL (
Browse files Browse the repository at this point in the history
  • Loading branch information
cmadjar authored Nov 11, 2022
1 parent 9c376bb commit e62ea82
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit e62ea82

Please sign in to comment.