@@ -94,22 +94,16 @@ func do(
9494 return attempts , nil
9595}
9696
97- func (c * Client ) Do (ctx context.Context , op query.Operation , opts ... options.DoOption ) (err error ) {
98- var (
99- onDone = trace .QueryOnDo (c .config .Trace (), & ctx ,
100- stack .FunctionID ("github.com/ydb-platform/ydb-go-sdk/3/internal/query.(*Client).Do" ),
101- )
102- attempts int
103- )
104- defer func () {
105- onDone (attempts , err )
106- }()
107-
97+ func (c * Client ) Do (ctx context.Context , op query.Operation , opts ... options.DoOption ) error {
10898 select {
10999 case <- c .done :
110100 return xerrors .WithStackTrace (errClosedClient )
111101 default :
112- attempts , err = do (ctx , c .pool , op , c .config .Trace (), opts ... )
102+ onDone := trace .QueryOnDo (c .config .Trace (), & ctx ,
103+ stack .FunctionID ("github.com/ydb-platform/ydb-go-sdk/3/internal/query.(*Client).Do" ),
104+ )
105+ attempts , err := do (ctx , c .pool , op , c .config .Trace (), opts ... )
106+ onDone (attempts , err )
113107
114108 return err
115109 }
@@ -162,8 +156,8 @@ func (c *Client) DoTx(ctx context.Context, op query.TxOperation, opts ...options
162156 case <- c .done :
163157 return xerrors .WithStackTrace (errClosedClient )
164158 default :
165- onDone := trace .QueryOnDoTx (c .config .Trace (), & ctx , stack . FunctionID (
166- "github.com/ydb-platform/ydb-go-sdk/3/internal/query.(*Client).DoTx" ),
159+ onDone := trace .QueryOnDoTx (c .config .Trace (), & ctx ,
160+ stack . FunctionID ( "github.com/ydb-platform/ydb-go-sdk/3/internal/query.(*Client).DoTx" ),
167161 )
168162 attempts , err := doTx (ctx , c .pool , op , c .config .Trace (), opts ... )
169163 onDone (attempts , err )
0 commit comments