Skip to content

Commit

Permalink
handle ctx.Done() in acquire (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
threadedstream committed Feb 23, 2024
1 parent 98ddea0 commit 51cea28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ func (ch *clickhouse) acquire(ctx context.Context) (conn *connect, err error) {
select {
case <-timer.C:
return nil, ErrAcquireConnTimeout
case <-ctx.Done():
return nil, ctx.Err()
case ch.open <- struct{}{}:
}
select {
Expand Down

0 comments on commit 51cea28

Please sign in to comment.