Verify client is closed

This commit is contained in:
Dan Sosedoff 2022-12-02 13:59:22 -06:00
parent bc54c95140
commit 73dfcc46c3
No known key found for this signature in database
GPG Key ID: 26186197D282B164
2 changed files with 5 additions and 0 deletions

View File

@ -75,5 +75,6 @@ func TestSessionManager(t *testing.T) {
command.Opts.ConnectionIdleTimeout = 1
assert.Equal(t, 1, manager.Cleanup())
assert.Equal(t, 0, manager.Len())
assert.True(t, conn.IsClosed())
})
}

View File

@ -442,6 +442,10 @@ func (client *Client) Close() error {
return nil
}
func (c *Client) IsClosed() bool {
return c.closed
}
func (client *Client) IsIdle() bool {
mins := int(time.Since(client.lastQueryTime).Minutes())