Skip to content
Snippets Groups Projects
Unverified Commit 5e781ec4 authored by 赵云兴's avatar 赵云兴 Committed by GitHub
Browse files

fix:generic method timeout (#1338)

parent 04842e84
No related branches found
No related tags found
No related merge requests found
......@@ -168,7 +168,14 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati
// get timeout including methodConfig
func (di *DubboInvoker) getTimeout(invocation *invocation_impl.RPCInvocation) time.Duration {
var timeout = di.GetURL().GetParam(strings.Join([]string{constant.METHOD_KEYS, invocation.MethodName(), constant.TIMEOUT_KEY}, "."), "")
methodName := invocation.MethodName()
if di.GetURL().GetParamBool(constant.GENERIC_KEY, false) {
methodName = invocation.Arguments()[0].(string)
}
key := strings.Join([]string{constant.METHOD_KEYS, methodName, constant.TIMEOUT_KEY}, ".")
timeout := di.GetURL().GetParam(key, "")
if len(timeout) != 0 {
if t, err := time.ParseDuration(timeout); err == nil {
// config timeout into attachment
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment