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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user