Merge pull request #303 from ldinc/issue#282

Issue#282
This commit is contained in:
Dan Sosedoff
2017-10-20 22:14:26 -05:00
committed by GitHub
3 changed files with 29 additions and 27 deletions

View File

@@ -197,7 +197,7 @@ func Run() {
}
// Start session cleanup worker
if options.Sessions {
if options.Sessions && !command.Opts.ConnectionIdleTimeoutDisabled {
go api.StartSessionCleanup()
}

View File

@@ -367,7 +367,7 @@ func (client *Client) Close() error {
}
func (client *Client) IsIdle() bool {
return time.Since(client.lastQueryTime).Hours() > 1
return time.Since(client.lastQueryTime).Minutes() > command.Opts.ConnectionIdleTimeout
}
// Fetch all rows as strings for a single column

View File

@@ -34,6 +34,8 @@ type Options struct {
ConnectBackend string `long:"connect-backend" description:"Enable database authentication through a third party backend"`
ConnectToken string `long:"connect-token" description:"Authentication token for the third-party connect backend"`
ConnectHeaders string `long:"connect-headers" description:"List of headers to pass to the connect backend"`
ConnectionIdleTimeoutDisabled bool `long:"disable-connection-idle-timeout" description:"Disable connection idle timeout" default:"false"`
ConnectionIdleTimeout float64 `long:"idle-timeout" description:"Set connection idle timeout in minutes" default:"180"`
}
var Opts Options