Specs refactor and tweaks
- Make ParseOptions func to take an arg and return struct so we can test it - Refactor and add more tests for options parsing - Run test suite on postgres 10.x branch - Change format for connection idle timer from float64 to in
This commit is contained in:
@@ -367,7 +367,13 @@ func (client *Client) Close() error {
|
||||
}
|
||||
|
||||
func (client *Client) IsIdle() bool {
|
||||
return time.Since(client.lastQueryTime).Minutes() > command.Opts.ConnectionIdleTimeout
|
||||
mins := int(time.Since(client.lastQueryTime).Minutes())
|
||||
|
||||
if command.Opts.ConnectionIdleTimeout > 0 {
|
||||
return mins >= command.Opts.ConnectionIdleTimeout
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// Fetch all rows as strings for a single column
|
||||
|
||||
Reference in New Issue
Block a user