From a9cdc58b6b8076c4e81e10a556d8f8807b0c07eb Mon Sep 17 00:00:00 2001 From: wangxinbiao <1412146116@qq.com> Date: Thu, 14 Mar 2024 17:41:51 +0800 Subject: [PATCH] fix:Convert chunkSize and worker values to int type. --- pypi/data-processing/src/common/config.py | 6 ++++-- pypi/data-processing/src/server.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pypi/data-processing/src/common/config.py b/pypi/data-processing/src/common/config.py index 2b5fcc99f..14279e537 100644 --- a/pypi/data-processing/src/common/config.py +++ b/pypi/data-processing/src/common/config.py @@ -73,11 +73,13 @@ def __set_property_value(self): namespace=k8s_pod_namespace, config_map_name=k8s_default_config ) # chunk size - self.knowledge_chunk_size = dataprocess.get("chunkSize", 500) + chunkSize = dataprocess.get("chunkSize", 500) + self.knowledge_chunk_size = int(chunkSize) # chunk overlap self.knowledge_chunk_overlap = 50 # worker - self.worker = dataprocess.get("worker", 1) + worker = dataprocess.get("worker", 1) + self.workers = int(worker) # backend PostgreSQL postgresql_config = postgresql_cr.get_postgresql_config_in_k8s_configmap( diff --git a/pypi/data-processing/src/server.py b/pypi/data-processing/src/server.py index b59c63013..8e328f762 100644 --- a/pypi/data-processing/src/server.py +++ b/pypi/data-processing/src/server.py @@ -88,4 +88,4 @@ def _create_database_connection(): if __name__ == "__main__": - sanic_app.run(host="0.0.0.0", port=28888, access_log=False, debug=False, workers=config.worker) + sanic_app.run(host="0.0.0.0", port=28888, access_log=False, debug=False, workers=config.workers)