Skip to content

Commit

Permalink
fix:Convert chunkSize and worker values to int type.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxinbiao committed Mar 14, 2024
1 parent 9bc7c15 commit 7a47933
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
Empty file.
25 changes: 25 additions & 0 deletions log/manipulate_server_2024-03-14.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
2024-03-14 17:43:33,742 [INFO] -
┌────────────────────────────────────────────────────────────────┐
│ Sanic v23.6.0 │
│ Goin' Fast @ http://0.0.0.0:28888 │
├───────────────────────┬────────────────────────────────────────┤
│ │ mode: production, single worker │
│ ▄███ █████ ██ │ server: sanic, HTTP/1.1 │
│ ██ │ python: 3.9.18 │
│ ▀███████ ███▄ │ platform: macOS-14.1.1-arm64-arm-64bit │
│ ██ │ packages: sanic-routing==23.6.0 │
│ ████ ████████▀ │ │
│ │ │
│ Build Fast. Run Fast. │ │
└───────────────────────┴────────────────────────────────────────┘

2024-03-14 17:43:33,743 [WARNING] - Sanic is running in PRODUCTION mode. Consider using '--debug' or '--dev' while actively developing your application.
2024-03-14 17:43:37,179 [DEBUG] - DataBase PostgreSQL Get a database connection pool.
2024-03-14 17:43:37,181 [INFO] - Starting worker [55431]
2024-03-14 17:43:45,050 [INFO] - Received signal SIGINT. Shutting down.
2024-03-14 17:43:45,053 [INFO] - Server Stopped
2024-03-14 17:43:45,213 [INFO] - Stopping worker [55431]
2024-03-14 17:43:45,214 [DEBUG] - DataBase PostgreSQL Release the database connection pool.
2024-03-14 17:43:45,243 [INFO] - Shutdown interrupted. Killing.
2024-03-14 17:43:45,243 [INFO] - Killing Sanic-Server-0-0 [55431]
2024-03-14 17:43:45,243 [INFO] - Received signal SIGINT. Shutting down.
6 changes: 4 additions & 2 deletions pypi/data-processing/src/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion pypi/data-processing/src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ 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)
print(config.workers)
sanic_app.run(host="0.0.0.0", port=28888, access_log=False, debug=False, workers=config.workers)

0 comments on commit 7a47933

Please sign in to comment.