Skip to content

Commit 2b869c5

Browse files
committed
removed pool stub
1 parent 0a6d3b7 commit 2b869c5

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

internal/query/client.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030

3131
var (
3232
_ query.Client = (*Client)(nil)
33-
_ sessionPool = (*poolStub)(nil)
3433
_ sessionPool = (*pool.Pool[*Session, Session])(nil)
3534
)
3635

@@ -41,9 +40,6 @@ type (
4140
Stats() pool.Stats
4241
With(ctx context.Context, f func(ctx context.Context, s *Session) error, opts ...retry.Option) error
4342
}
44-
poolStub struct {
45-
createSession func(ctx context.Context) (*Session, error)
46-
}
4743
Client struct {
4844
config *config.Config
4945
queryServiceClient Ydb_Query_V1.QueryServiceClient
@@ -187,43 +183,6 @@ func (c *Client) ExecuteScript(
187183
return op, nil
188184
}
189185

190-
func (p *poolStub) Close(context.Context) error {
191-
return nil
192-
}
193-
194-
func (p *poolStub) Stats() pool.Stats {
195-
return pool.Stats{
196-
Limit: -1,
197-
Idle: 0,
198-
}
199-
}
200-
201-
func (p *poolStub) With(
202-
ctx context.Context, f func(ctx context.Context, s *Session) error, opts ...retry.Option,
203-
) error {
204-
err := retry.Retry(ctx, func(ctx context.Context) (err error) {
205-
s, err := p.createSession(ctx)
206-
if err != nil {
207-
return xerrors.WithStackTrace(err)
208-
}
209-
defer func() {
210-
_ = s.Close(ctx)
211-
}()
212-
213-
err = f(ctx, s)
214-
if err != nil {
215-
return xerrors.WithStackTrace(err)
216-
}
217-
218-
return nil
219-
}, opts...)
220-
if err != nil {
221-
return xerrors.WithStackTrace(err)
222-
}
223-
224-
return nil
225-
}
226-
227186
func (c *Client) Close(ctx context.Context) error {
228187
close(c.done)
229188

0 commit comments

Comments
 (0)