refactor
This commit is contained in:
parent
80f04e5449
commit
c7ce79ebbe
@ -48,11 +48,11 @@ def make_connection() -> pika.BlockingConnection:
|
||||
return connection
|
||||
|
||||
|
||||
def build_message_bodies(analyse_container_type, bucket_name):
|
||||
def build_message_bodies(analysis_container, bucket_name):
|
||||
def update_message(message_dict):
|
||||
if analyse_container_type == "detr" or analyse_container_type == "image":
|
||||
if analysis_container == "detr" or analysis_container == "image":
|
||||
message_dict.update({"targetFileExtension": "ORIGIN.pdf.gz", "responseFileExtension": "IMAGE_INFO.json.gz"})
|
||||
if analyse_container_type == "conversion":
|
||||
if analysis_container == "conversion":
|
||||
message_dict.update(
|
||||
{
|
||||
"targetFileExtension": "ORIGIN.pdf.gz",
|
||||
@ -61,20 +61,20 @@ def build_message_bodies(analyse_container_type, bucket_name):
|
||||
"pages": [1, 2, 3],
|
||||
}
|
||||
)
|
||||
if analyse_container_type == "table_parsing":
|
||||
if analysis_container == "table_parsing":
|
||||
message_dict.update(
|
||||
{
|
||||
"operation": "table_parsing",
|
||||
"pages": [1, 2, 3],
|
||||
}
|
||||
)
|
||||
if analyse_container_type == "extraction":
|
||||
if analysis_container == "extraction":
|
||||
message_dict.update(
|
||||
{"targetFileExtension": "ORIGIN.pdf.gz", "responseFileExtension": "json.gz", "operation": "extraction"}
|
||||
)
|
||||
if analyse_container_type == "dl_error":
|
||||
if analysis_container == "dl_error":
|
||||
message_dict.update({"targetFileExtension": "no_such_file", "responseFileExtension": "IMAGE_INFO.json.gz"})
|
||||
if analyse_container_type == "ner":
|
||||
if analysis_container == "ner":
|
||||
message_dict.update(
|
||||
{"targetFileExtension": "TEXT.json.gz", "responseFileExtension": "NER_ENTITIES.json.gz"}
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user