From 2093bbf9f69736005306d92025d328ce66aa0f79 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Mon, 5 Feb 2024 14:17:52 +0800 Subject: [PATCH] fix: adjust --- app/__init__.py | 2 +- docker-compose-run.yml | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index f5618c8..1e43e91 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -32,7 +32,7 @@ def load_rpc_client(apiflask_app): rpc.init_app(apiflask_app, extra_config={ 'INITIAL_CONNECTIONS': 2, 'MAX_CONNECTIONS': 10, - 'POOL_RECYCLE': 360 # 6 分钟后过期所有已有链接 + 'POOL_RECYCLE': 1800 # 30 分钟后过期所有已有链接 }) diff --git a/docker-compose-run.yml b/docker-compose-run.yml index ac3fcc6..04c4dc3 100644 --- a/docker-compose-run.yml +++ b/docker-compose-run.yml @@ -13,19 +13,26 @@ services: deploy: mode: replicated replicas: 2 + resources: + reservations: + cpus: '0.02' + memory: 50M + limits: + cpus: '0.10' + memory: 300M update_config: parallelism: 1 failure_action: rollback restart_policy: condition: on-failure delay: 5s - max_attempts: 3 + max_attempts: 1 window: 120s placement: constraints: - 'node.role == worker' networks: - - pzx-web-api-network + - ddk-network # pzx-web-api-2: # image: gitea.bearcatlog.com/bryant/ddk/pzx-web-api:latest # env_file: @@ -50,8 +57,9 @@ services: # constraints: # - 'node.role == worker' # networks: -# - pzx-web-api-network +# - ddk-network networks: - pzx-web-api-network: - driver: overlay \ No newline at end of file + ddk-network: + driver: overlay + attachable: true \ No newline at end of file