From ccf5df87e701c7e85bbda7745dcdb644c9db88a7 Mon Sep 17 00:00:00 2001 From: "dc.To" Date: Fri, 27 Jun 2025 14:37:24 +0800 Subject: [PATCH] update timeout invoker --- chain/clientchain.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chain/clientchain.go b/chain/clientchain.go index a951ccd..d0dba45 100644 --- a/chain/clientchain.go +++ b/chain/clientchain.go @@ -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) }