Merge pull request #112 from SDSRV-IDP/fix/negative_processing_time

Fix/negative processing time
This commit is contained in:
Le Van Tuan 2024-05-02 14:28:03 +07:00 committed by GitHub Enterprise
commit eceb22eb93
5 changed files with 6 additions and 4 deletions

@ -1 +1 @@
Subproject commit 910420b53636b43af540e72237c06f49127163d3
Subproject commit 3a1904810a334b95baec7265cdcee28535255c18

View File

@ -214,7 +214,7 @@ CELERY_TASK_TIME_LIMIT = None
MAX_UPLOAD_SIZE_OF_A_FILE = 5 * 1024 * 1024 # 5 MB
MAX_UPLOAD_FILE_SIZE_OF_A_REQUEST = 100 * 1024 * 1024 # 100 MB
MAX_UPLOAD_FILES_IN_A_REQUEST = 5
MAX_UPLOAD_FILES_IN_A_REQUEST = 2
MAX_PIXEL_IN_A_FILE = 5000
TARGET_MAX_IMAGE_SIZE = (2048, 2048)
SIZE_TO_COMPRESS = 2 * 1024 * 1024

View File

@ -827,6 +827,8 @@ def calculate_a_request(report, request):
images = SubscriptionRequestFile.objects.filter(request=request, file_category=FileCategory.Origin.value)
report_files = []
for image in images:
if image.processing_time < 0:
continue
status, att = calculate_subcription_file(image)
att["acc"]["feedback"], fb_max_indexes = acc_maximize_list_values(att["acc"]["feedback"])
att["acc"]["reviewed"], rv_max_indexes = acc_maximize_list_values(att["acc"]["reviewed"])

View File

@ -136,7 +136,7 @@ def sbt_validate_ocr_request_and_get(request, subscription):
invoice_file = request.data.getlist('invoice_file')
redemption_ID = request.data.get('redemption_ID', None)
FileUtils.validate_list_file(imei_files, file_field="imei_file")
FileUtils.validate_list_file(imei_files, max_file_num=settings.MAX_UPLOAD_FILES_IN_A_REQUEST, min_file_num=0, file_field="imei_file")
FileUtils.validate_list_file(invoice_file, max_file_num=1, min_file_num=0, file_field="invoice_file")
validated_data['imei_file'] = imei_files

@ -1 +1 @@
Subproject commit b7baf4954e592068288c606376b035b41dd9e319
Subproject commit 3a1904810a334b95baec7265cdcee28535255c18