@@ -66,25 +66,6 @@ def obtain_current_ack_content(temp_ack_file_key: str) -> StringIO:
6666 return accumulated_csv_content
6767
6868
69- def handle_ingestion_complete (
70- temp_ack_file_key : str ,
71- message_id : str ,
72- supplier : str ,
73- vaccine_type : str ,
74- archive_ack_file_key : str ,
75- file_key : str ,
76- ) -> None :
77- """Handles processing where the complete file has been ingested"""
78- move_file (ACK_BUCKET_NAME , temp_ack_file_key , archive_ack_file_key )
79- move_file (SOURCE_BUCKET_NAME , f"processing/{ file_key } " , f"archive/{ file_key } " )
80- # Update the audit table and invoke the filename lambda with next file in the queue (if one exists)
81- change_audit_table_status_to_processed (file_key , message_id )
82- supplier_queue = f"{ supplier } _{ vaccine_type } "
83- next_queued_file_details = get_next_queued_file_details (supplier_queue )
84- if next_queued_file_details :
85- invoke_filename_lambda (next_queued_file_details ["filename" ], next_queued_file_details ["message_id" ])
86-
87-
8869@upload_ack_file_logging_decorator
8970def upload_ack_file (
9071 temp_ack_file_key : str ,
@@ -108,14 +89,14 @@ def upload_ack_file(
10889 row_count_destination = get_row_count (ACK_BUCKET_NAME , temp_ack_file_key )
10990 # TODO: Should we check for > and if so what handling is required
11091 if row_count_destination == row_count_source :
111- handle_ingestion_complete (
112- temp_ack_file_key ,
113- message_id ,
114- supplier ,
115- vaccine_type ,
116- archive_ack_file_key ,
117- file_key ,
118- )
92+ move_file ( ACK_BUCKET_NAME , temp_ack_file_key , archive_ack_file_key )
93+ move_file ( SOURCE_BUCKET_NAME , f"processing/ { file_key } " , f"archive/ { file_key } " )
94+ # Update the audit table and invoke the filename lambda with next file in the queue (if one exists)
95+ change_audit_table_status_to_processed ( file_key , message_id )
96+ supplier_queue = f" { supplier } _ { vaccine_type } "
97+ next_queued_file_details = get_next_queued_file_details ( supplier_queue )
98+ if next_queued_file_details :
99+ invoke_filename_lambda ( next_queued_file_details [ "filename" ], next_queued_file_details [ "message_id" ] )
119100 # Ingestion of this file is complete
120101 result = {
121102 "message_id" : message_id ,
0 commit comments