diff --git a/cope2n-api/fwd_api/api/ctel_view.py b/cope2n-api/fwd_api/api/ctel_view.py index de752c0..57155e2 100755 --- a/cope2n-api/fwd_api/api/ctel_view.py +++ b/cope2n-api/fwd_api/api/ctel_view.py @@ -215,6 +215,7 @@ class CtelViewSet(viewsets.ViewSet): "invoice": invoice_file_objs } rq_id = provider_code + "_" + datetime.now().strftime("%Y%m%d%H%M%S") + "_" + uuid.uuid4().hex + count = 0 doc_files_with_type = [] for doc_type, doc_files in files.items(): diff --git a/cope2n-api/fwd_api/celery_worker/internal_task.py b/cope2n-api/fwd_api/celery_worker/internal_task.py index aed978c..04d875f 100755 --- a/cope2n-api/fwd_api/celery_worker/internal_task.py +++ b/cope2n-api/fwd_api/celery_worker/internal_task.py @@ -116,7 +116,7 @@ def process_pdf(rq_id, sub_id, p_type, user_id, files): file_meta["index_in_request"] = i file_meta["preprocessing_time"] = preprocessing_time to_queue.append((fractorized_request_id, sub_id, [b_url], user_id, p_type, file_meta)) - + # Send to next 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) diff --git a/cope2n-api/fwd_api/celery_worker/process_result_tasks.py b/cope2n-api/fwd_api/celery_worker/process_result_tasks.py index 5c2cc7c..946ad81 100755 --- a/cope2n-api/fwd_api/celery_worker/process_result_tasks.py +++ b/cope2n-api/fwd_api/celery_worker/process_result_tasks.py @@ -147,6 +147,7 @@ def process_invoice_sbt_result(rq_id, result, metadata): rq_id = rq_id.split("_sub_")[0] rq: SubscriptionRequest = SubscriptionRequest.objects.filter(request_id=rq_id).first() + result["metadata"] = metadata # status = to_status(result) 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.preprocessing_time = result["metadata"]["preprocessing_time"] # advancing the last result rq.ai_inference_time = time.time() - rq.ai_inference_start_time + rq.save() else: