WaitForNotification detects lost connections quicker
Ping server every 15 seconds while waiting if no traffic has occurred.
This commit is contained in:
@@ -357,7 +357,8 @@ func (rows *Rows) Values() ([]interface{}, error) {
|
||||
// be returned in an error state. So it is allowed to ignore the error returned
|
||||
// from Query and handle it in *Rows.
|
||||
func (c *Conn) Query(sql string, args ...interface{}) (*Rows, error) {
|
||||
rows := &Rows{conn: c, startTime: time.Now(), sql: sql, args: args, logger: c.logger}
|
||||
c.lastActivityTime = time.Now()
|
||||
rows := &Rows{conn: c, startTime: c.lastActivityTime, sql: sql, args: args, logger: c.logger}
|
||||
|
||||
ps, ok := c.preparedStatements[sql]
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user