Skip to content

Commit

Permalink
Merge pull request #90 from ZC-A/fix/api-plugin-timeout-config
Browse files Browse the repository at this point in the history
fix: API 插件超时时间支持任务模块级别配置 #87
  • Loading branch information
normal-wls authored Jan 8, 2025
2 parents a04fdca + dd448b9 commit 392cef5
Show file tree
Hide file tree
Showing 7 changed files with 885 additions and 885 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: flake8
language_version: python3
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v2.2.0
rev: v9.20.0
hooks:
- id: commitlint
stages: [ commit-msg ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ def _dispatch_schedule_polling(self, data, parent_data, callback_data=None):
)
try:
request_result: HttpRequestResult = client.request(
url=polling_config.url, method="get", data=api_data, headers=headers, timeout=30
url=polling_config.url,
method="get",
data=api_data,
headers=headers,
timeout=settings.BKAPP_API_PLUGIN_REQUEST_TIMEOUT,
)
except Exception as e:
message = handle_plain_log("[uniform_api polling error] url request failed: {}".format(e))
Expand Down
3 changes: 3 additions & 0 deletions env.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
# 默认引擎模块入口
BKAPP_DEFAULT_ENGINE_MODULE_ENTRY = os.getenv("BKAPP_DEFAULT_ENGINE_MODULE_ENTRY", "")

# 默认引擎插件超时时间
BKAPP_API_PLUGIN_REQUEST_TIMEOUT = int(os.getenv("BKAPP_API_PLUGIN_REQUEST_TIMEOUT", 30))

CALLBACK_KEY = os.getenv("BKFLOW_DEFAULT_CALLBACK_KEY", "").encode("utf-8")

BK_PAAS_ESB_HOST = os.getenv("BK_COMPONENT_API_URL", "")
Expand Down
Binary file modified locale/en/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 392cef5

Please sign in to comment.