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

fix(config): correct the function signature of the rpcinfo.TimeoutProvider implementation #1038

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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