fix(ui): 保留业务HTTP配置超时
build / build (push) Successful in 1m33s

F13 动态客户端原先把 TEST_WEKNORA_HTTP_TIMEOUT(默认 60s)强制截成 10s,
与 readiness 探针上限混用,导致上传/轮询等业务请求 10s 即超时。

现在显式正超时原样传入;未配置/非正值回落到 appconfig 的 60s 默认。
readiness 探测自己的 10s 上限不变。

新增本地 httptest:60s 配置下 11s 响应成功,显式 50ms 短超时仍生效;
端点/凭据/绑定动态解析回归保持通过。make verify 17 项通过。
This commit is contained in:
姚章浩
2026-11-05 12:03:42 +08:00
parent 5bf4aae30e
commit 7675e2cd88
3 changed files with 72 additions and 2 deletions
+6 -2
View File
@@ -11,6 +11,10 @@ import (
var ErrNotConfigured = errors.New("WeKnora 有效端点/凭据未配置")
// defaultBusinessTimeout matches appconfig's TEST_WEKNORA_HTTP_TIMEOUT default.
// The readiness probe has its own 10s cap; it must not bound upload/poll calls.
const defaultBusinessTimeout = 60 * time.Second
// Client resolves the effective WeKnora target on every call. It deliberately
// owns no cached *weknora.Client: endpoint, key and binding are console-managed.
type Client struct {
@@ -28,8 +32,8 @@ func (client *Client) with(ctx context.Context, call func(*weknora.Client) error
return ErrNotConfigured
}
timeout := client.Timeout
if timeout <= 0 || timeout > 10*time.Second {
timeout = 10 * time.Second
if timeout <= 0 {
timeout = defaultBusinessTimeout
}
remote, err := weknora.NewClient(weknora.ClientConfig{
BaseURL: target.BaseURL,