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