mirror of https://github.com/jackc/pgx.git
parent
0a2b67c5c5
commit
82bac82213
|
@ -370,7 +370,15 @@ func (c *Conn) Ping(ctx context.Context) error {
|
||||||
return driver.ErrBadConn
|
return driver.ErrBadConn
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.conn.Ping(ctx)
|
err := c.conn.Ping(ctx)
|
||||||
|
if err != nil {
|
||||||
|
// A Ping failure implies some sort of fatal state. The connection is almost certainly already closed by the
|
||||||
|
// failure, but manually close it just to be sure.
|
||||||
|
c.Close()
|
||||||
|
return driver.ErrBadConn
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) CheckNamedValue(*driver.NamedValue) error {
|
func (c *Conn) CheckNamedValue(*driver.NamedValue) error {
|
||||||
|
|
Loading…
Reference in New Issue