更新超时链
This commit is contained in:
parent
ccf5df87e7
commit
fe25f60b5d
@ -18,8 +18,6 @@ import (
|
|||||||
* @version 20250409
|
* @version 20250409
|
||||||
*/
|
*/
|
||||||
func ClientTimeoutInvokerChain(ctx context.Context, method string, req, res interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
|
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, 5*time.Second)
|
|
||||||
defer cancel()
|
|
||||||
return invoker(ctx, method, req, res, cc, opts...)
|
return invoker(ctx, method, req, res, cc, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user