Merge branch 'main' into fix/database_inconsistent
This commit is contained in:
commit
71ca689e89
@ -215,6 +215,7 @@ class CtelViewSet(viewsets.ViewSet):
|
|||||||
"invoice": invoice_file_objs
|
"invoice": invoice_file_objs
|
||||||
}
|
}
|
||||||
rq_id = provider_code + "_" + datetime.now().strftime("%Y%m%d%H%M%S") + "_" + uuid.uuid4().hex
|
rq_id = provider_code + "_" + datetime.now().strftime("%Y%m%d%H%M%S") + "_" + uuid.uuid4().hex
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
doc_files_with_type = []
|
doc_files_with_type = []
|
||||||
for doc_type, doc_files in files.items():
|
for doc_type, doc_files in files.items():
|
||||||
|
@ -116,7 +116,7 @@ def process_pdf(rq_id, sub_id, p_type, user_id, files):
|
|||||||
file_meta["index_in_request"] = i
|
file_meta["index_in_request"] = i
|
||||||
file_meta["preprocessing_time"] = preprocessing_time
|
file_meta["preprocessing_time"] = preprocessing_time
|
||||||
to_queue.append((fractorized_request_id, sub_id, [b_url], user_id, p_type, file_meta))
|
to_queue.append((fractorized_request_id, sub_id, [b_url], user_id, p_type, file_meta))
|
||||||
|
|
||||||
# Send to next queue
|
# Send to next queue
|
||||||
for sub_rq_id, sub_id, urls, user_id, p_type, metadata in to_queue:
|
for sub_rq_id, sub_id, urls, user_id, p_type, metadata in to_queue:
|
||||||
ProcessUtil.send_to_queue2(sub_rq_id, sub_id, urls, user_id, p_type, metadata)
|
ProcessUtil.send_to_queue2(sub_rq_id, sub_id, urls, user_id, p_type, metadata)
|
||||||
|
@ -147,6 +147,7 @@ def process_invoice_sbt_result(rq_id, result, metadata):
|
|||||||
rq_id = rq_id.split("_sub_")[0]
|
rq_id = rq_id.split("_sub_")[0]
|
||||||
rq: SubscriptionRequest = SubscriptionRequest.objects.filter(request_id=rq_id).first()
|
rq: SubscriptionRequest = SubscriptionRequest.objects.filter(request_id=rq_id).first()
|
||||||
|
|
||||||
|
|
||||||
result["metadata"] = metadata
|
result["metadata"] = metadata
|
||||||
# status = to_status(result)
|
# status = to_status(result)
|
||||||
status = result.get("status", 200)
|
status = result.get("status", 200)
|
||||||
@ -169,6 +170,7 @@ def process_invoice_sbt_result(rq_id, result, metadata):
|
|||||||
rq.ai_inference_start_time = result["metadata"]["ai_inference_start_time"] # advancing the last result
|
rq.ai_inference_start_time = result["metadata"]["ai_inference_start_time"] # advancing the last result
|
||||||
rq.preprocessing_time = result["metadata"]["preprocessing_time"] # advancing the last result
|
rq.preprocessing_time = result["metadata"]["preprocessing_time"] # advancing the last result
|
||||||
rq.ai_inference_time = time.time() - rq.ai_inference_start_time
|
rq.ai_inference_time = time.time() - rq.ai_inference_start_time
|
||||||
|
|
||||||
rq.save()
|
rq.save()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user