mirror of
https://github.com/jackc/pgx.git
synced 2025-05-30 11:14:05 +00:00
conn.Close closes underlying conn
Previously, it merely sent the termination message.
This commit is contained in:
parent
f597c16a7b
commit
84802ece05
5
conn.go
5
conn.go
@ -425,6 +425,11 @@ func (c *Conn) Close() (err error) {
|
||||
}
|
||||
|
||||
_, err = c.conn.Write([]byte{'X', 0, 0, 0, 4})
|
||||
if err != nil && c.shouldLog(LogLevelWarn) {
|
||||
c.log(LogLevelWarn, "Failed to send terminate message", "err", err)
|
||||
}
|
||||
|
||||
err = c.conn.Close()
|
||||
|
||||
c.die(errors.New("Closed"))
|
||||
if c.shouldLog(LogLevelInfo) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user