Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client不支持ms级别的timeout #2086

Closed
aeternae opened this issue Oct 21, 2022 · 1 comment
Closed

client不支持ms级别的timeout #2086

aeternae opened this issue Oct 21, 2022 · 1 comment

Comments

@aeternae
Copy link

opts := []triConfig.OptionFunction{
triConfig.WithClientTimeout(uint32(timeout.Seconds())),
triConfig.WithCodecType(triCodecType),
triConfig.WithLocation(url.Location),
triConfig.WithHeaderAppVersion(url.GetParam(constant.AppVersionKey, "")),
triConfig.WithHeaderGroup(url.GetParam(constant.GroupKey, "")),
triConfig.WithLogger(logger.GetLogger()),
}
ms级别的timeout会被转化成秒级后,被uint32类型转化成0值

func (o *Option) Validate() {
if o.Timeout == uint32(0) {
o.Timeout = uint32(constant.DefaultTimeout)
}
...
}
0值被修改成默认的15s

What would you like to be added:

Why is this needed:

@zhaoyunxing92
Copy link
Contributor

我建议修改WithClientTimeout的参数类型会比较合理点

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants