feat: support the specified timeout of rpc methods (#2742)
Co-authored-by: hanzijian <hanzijian@52tt.com> Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
@@ -131,8 +131,12 @@ func setupInterceptors(svr internal.Server, c RpcServerConf, metrics *stat.Metri
|
||||
}
|
||||
|
||||
if c.Timeout > 0 {
|
||||
svr.AddUnaryInterceptors(serverinterceptors.UnaryTimeoutInterceptor(
|
||||
time.Duration(c.Timeout) * time.Millisecond))
|
||||
svr.AddUnaryInterceptors(
|
||||
serverinterceptors.UnaryTimeoutInterceptor(
|
||||
time.Duration(c.Timeout)*time.Millisecond,
|
||||
c.SpecifiedTimeouts...,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
if c.Auth {
|
||||
|
||||
Reference in New Issue
Block a user