update timeout invoker
This commit is contained in:
parent
c680bd2d5e
commit
ccf5df87e7
@ -18,19 +18,18 @@ import (
|
||||
* @version 20250409
|
||||
*/
|
||||
func ClientTimeoutInvokerChain(ctx context.Context, method string, req, res interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
|
||||
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
defer cancel()
|
||||
return invoker(ctx, method, req, res, cc, opts...)
|
||||
}
|
||||
|
||||
/**
|
||||
* 上下文拦截链
|
||||
* 上下文调用链
|
||||
* @param void
|
||||
* @author dc.To
|
||||
* @version 20250424
|
||||
*/
|
||||
func ClientContextInvokerChain(ctx context.Context, method string, req, res interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
|
||||
|
||||
return invoker(ctx, method, req, nil, cc, opts...)
|
||||
}
|
||||
|
||||
@ -41,7 +40,6 @@ func ClientContextInvokerChain(ctx context.Context, method string, req, res inte
|
||||
* @version 20250425
|
||||
*/
|
||||
func ClientContextUnaryChain(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
||||
|
||||
return handler(ctx, req)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user