Skip to content

Commit 1d7ef42

Browse files
committed
feat: 支持配置网关超时时间
1 parent 6de91a6 commit 1d7ef42

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

bk-plugin-framework/bk_plugin_framework/services/bpf_service/management/commands/data/api-definition.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ stage:
77
vars: {}
88
{% endif %}
99
proxy_http:
10-
timeout: 60
10+
timeout: '{{ settings.BK_APIGW_DEFAULT_TIMEOUT }}'
1111
upstreams:
1212
loadbalance: "roundrobin"
1313
hosts:

runtime/bk-plugin-runtime/bk_plugin_runtime/config/default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,4 @@ def logging_addition_settings(logging_dict):
246246
BK_APIGW_CORS_ALLOW_ORIGINS = os.getenv("BK_APIGW_CORS_ALLOW_ORIGINS", "")
247247
BK_APIGW_CORS_ALLOW_METHODS = os.getenv("BK_APIGW_CORS_ALLOW_METHODS", "")
248248
BK_APIGW_CORS_ALLOW_HEADERS = os.getenv("BK_APIGW_CORS_ALLOW_HEADERS", "")
249+
BK_APIGW_DEFAULT_TIMEOUT = int(os.getenv("BK_APIGW_DEFAULT_TIMEOUT", "60"))

template/cookiecutter.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"apigw_cors_allow_origins": "''",
99
"apigw_cors_allow_methods": "GET,POST,PUT,PATCH,HEAD,DELETE,OPTIONS",
1010
"apigw_cors_allow_headers": "Accept,Cache-Control,Content-Type,Keep-Alive,Origin,User-Agent,X-Requested-With",
11+
"bk_apigw_default_timeout": "60",
1112
"_copy_without_render": [
1213
".ci"
1314
]
14-
}
15+
}

template/{{cookiecutter.project_name}}/app_desc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ modules:
5151
- name: BK_APIGW_CORS_ALLOW_HEADERS
5252
value: {{cookiecutter.apigw_cors_allow_headers}}
5353
description: apigw cors strategie allow headers
54+
- name: BK_APIGW_DEFAULT_TIMEOUT
55+
value: {{cookiecutter.bk_apigw_default_timeout}}
56+
description: apigw default timeout

0 commit comments

Comments
 (0)