adjust mock script

This commit is contained in:
Julius Unverfehrt 2022-03-22 15:42:08 +01:00
parent 429b6b8f3a
commit 2bc520c849

View File

@ -54,6 +54,8 @@ def build_message_bodies(analyse_container_type):
storage = get_s3_storage() storage = get_s3_storage()
for bucket_name, pdf_name in storage.get_all_object_names(CONFIG.storage.bucket): for bucket_name, pdf_name in storage.get_all_object_names(CONFIG.storage.bucket):
if "pdf" not in pdf_name:
continue
file_id = pdf_name.split(".")[0] file_id = pdf_name.split(".")[0]
dossier_id, file_id = file_id.split("/") dossier_id, file_id = file_id.split("/")
message_dict = {"dossierId": dossier_id, "fileId": file_id} message_dict = {"dossierId": dossier_id, "fileId": file_id}
@ -74,6 +76,7 @@ def main(args):
for method_frame, _, body in channel.consume(queue=CONFIG.rabbitmq.queues.output): for method_frame, _, body in channel.consume(queue=CONFIG.rabbitmq.queues.output):
print(f"Received {json.loads(body)}") print(f"Received {json.loads(body)}")
channel.basic_ack(method_frame.delivery_tag) channel.basic_ack(method_frame.delivery_tag)
channel.close()
if __name__ == "__main__": if __name__ == "__main__":