From 746cc0ce2bc2756cfc4a6836e605514f21e285c5 Mon Sep 17 00:00:00 2001 From: dx-tan Date: Tue, 6 Feb 2024 16:31:50 +0700 Subject: [PATCH] Fix: bypass all doc_type --- cope2n-api/fwd_api/celery_worker/internal_task.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cope2n-api/fwd_api/celery_worker/internal_task.py b/cope2n-api/fwd_api/celery_worker/internal_task.py index ca8ea38..23abef9 100755 --- a/cope2n-api/fwd_api/celery_worker/internal_task.py +++ b/cope2n-api/fwd_api/celery_worker/internal_task.py @@ -117,7 +117,10 @@ def process_csv_feedback(csv_file_path, feedback_id): _predict_result = copy.deepcopy(predict_result_to_ready(sub_rq.predict_result)) _feedback_result = copy.deepcopy(sub_rq.feedback_result) _reviewed_result = copy.deepcopy(sub_rq.reviewed_result) - image.processing_time = time_cost.get(image.doc_type, [0 for _ in range(image.index_in_request)])[image.index_in_request] + try: + image.processing_time = time_cost.get(image.doc_type, [0 for _ in range(image.index_in_request)])[image.index_in_request] + except Exception as e: + print(f"[ERROR] image.doc_type: {image.doc_type} - image.index_in_request: {image.index_in_request} - time_cost: {time_cost} - {e}") if not validate_feedback_file(_feedback_result, _predict_result): status[request_id] = "Missalign imei number between feedback and predict" continue