test: prove unhealthy schema startup boundary
This commit is contained in:
+6
-1
@@ -18,6 +18,7 @@ import (
|
||||
type Pool struct {
|
||||
dsn string
|
||||
reconnectInterval time.Duration
|
||||
open func(*clickhouse.Options) (clickhouse.Conn, error)
|
||||
mu sync.RWMutex
|
||||
conn clickhouse.Conn
|
||||
healthy bool
|
||||
@@ -40,7 +41,11 @@ func (p *Pool) connect(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
conn, err := clickhouse.Open(opts)
|
||||
open := p.open
|
||||
if open == nil {
|
||||
open = clickhouse.Open
|
||||
}
|
||||
conn, err := open(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user