Skip to content

Commit

Permalink
fix(config): correct the function signature of the rpcinfo.TimeoutPro…
Browse files Browse the repository at this point in the history
…vider implementation
  • Loading branch information
whalecold committed Jul 25, 2023
1 parent b26b928 commit d534906
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/rpctimeout/item_rpc_timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import (
)

var (
_ iface.ConfigValueItem = (*RPCTimeout)(nil)
_ rpcinfo.Timeouts = (*RPCTimeout)(nil)
_ iface.ConfigValueItem = (*RPCTimeout)(nil)
_ rpcinfo.Timeouts = (*RPCTimeout)(nil)
_ rpcinfo.TimeoutProvider = (*Container)(nil)
)

// TypeRPCTimeout is used as itemKey in ConfigValueImpl
Expand Down Expand Up @@ -134,7 +135,7 @@ func (c *Container) NotifyPolicyChange(configs map[string]*RPCTimeout) {
}

// Timeouts return the rpc timeout config by the method name of rpc info.
func (c *Container) Timeouts(ri rpcinfo.RPCInfo) *RPCTimeout {
func (c *Container) Timeouts(ri rpcinfo.RPCInfo) rpcinfo.Timeouts {
rtc := c.config.Load().(*rpcTimeoutConfig)
if config, ok := rtc.configs[ri.Invocation().MethodName()]; ok {
return config
Expand Down

0 comments on commit d534906

Please sign in to comment.