From 1d7ef4239353f13eff65ce062cf112e61238ce03 Mon Sep 17 00:00:00 2001 From: Vinceeee <491323832@qq.com> Date: Fri, 25 Jul 2025 14:15:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpf_service/management/commands/data/api-definition.yml | 2 +- runtime/bk-plugin-runtime/bk_plugin_runtime/config/default.py | 1 + template/cookiecutter.json | 3 ++- template/{{cookiecutter.project_name}}/app_desc.yml | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bk-plugin-framework/bk_plugin_framework/services/bpf_service/management/commands/data/api-definition.yml b/bk-plugin-framework/bk_plugin_framework/services/bpf_service/management/commands/data/api-definition.yml index ead7ab9..25ac8f7 100644 --- a/bk-plugin-framework/bk_plugin_framework/services/bpf_service/management/commands/data/api-definition.yml +++ b/bk-plugin-framework/bk_plugin_framework/services/bpf_service/management/commands/data/api-definition.yml @@ -7,7 +7,7 @@ stage: vars: {} {% endif %} proxy_http: - timeout: 60 + timeout: '{{ settings.BK_APIGW_DEFAULT_TIMEOUT }}' upstreams: loadbalance: "roundrobin" hosts: diff --git a/runtime/bk-plugin-runtime/bk_plugin_runtime/config/default.py b/runtime/bk-plugin-runtime/bk_plugin_runtime/config/default.py index 64b6422..7d194d5 100644 --- a/runtime/bk-plugin-runtime/bk_plugin_runtime/config/default.py +++ b/runtime/bk-plugin-runtime/bk_plugin_runtime/config/default.py @@ -246,3 +246,4 @@ def logging_addition_settings(logging_dict): BK_APIGW_CORS_ALLOW_ORIGINS = os.getenv("BK_APIGW_CORS_ALLOW_ORIGINS", "") BK_APIGW_CORS_ALLOW_METHODS = os.getenv("BK_APIGW_CORS_ALLOW_METHODS", "") BK_APIGW_CORS_ALLOW_HEADERS = os.getenv("BK_APIGW_CORS_ALLOW_HEADERS", "") +BK_APIGW_DEFAULT_TIMEOUT = int(os.getenv("BK_APIGW_DEFAULT_TIMEOUT", "60")) diff --git a/template/cookiecutter.json b/template/cookiecutter.json index 4b5d1a9..4d1d112 100644 --- a/template/cookiecutter.json +++ b/template/cookiecutter.json @@ -8,7 +8,8 @@ "apigw_cors_allow_origins": "''", "apigw_cors_allow_methods": "GET,POST,PUT,PATCH,HEAD,DELETE,OPTIONS", "apigw_cors_allow_headers": "Accept,Cache-Control,Content-Type,Keep-Alive,Origin,User-Agent,X-Requested-With", + "bk_apigw_default_timeout": "60", "_copy_without_render": [ ".ci" ] -} \ No newline at end of file +} diff --git a/template/{{cookiecutter.project_name}}/app_desc.yml b/template/{{cookiecutter.project_name}}/app_desc.yml index 790e734..cb71b87 100644 --- a/template/{{cookiecutter.project_name}}/app_desc.yml +++ b/template/{{cookiecutter.project_name}}/app_desc.yml @@ -51,3 +51,6 @@ modules: - name: BK_APIGW_CORS_ALLOW_HEADERS value: {{cookiecutter.apigw_cors_allow_headers}} description: apigw cors strategie allow headers + - name: BK_APIGW_DEFAULT_TIMEOUT + value: {{cookiecutter.bk_apigw_default_timeout}} + description: apigw default timeout