Skip to content

Commit 51cea28

Browse files
handle ctx.Done() in acquire (#1199)
1 parent 98ddea0 commit 51cea28

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clickhouse.go

+2
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ func (ch *clickhouse) acquire(ctx context.Context) (conn *connect, err error) {
265265
select {
266266
case <-timer.C:
267267
return nil, ErrAcquireConnTimeout
268+
case <-ctx.Done():
269+
return nil, ctx.Err()
268270
case ch.open <- struct{}{}:
269271
}
270272
select {

0 commit comments

Comments
 (0)