Verify client is closed
This commit is contained in:
@@ -75,5 +75,6 @@ func TestSessionManager(t *testing.T) {
|
|||||||
command.Opts.ConnectionIdleTimeout = 1
|
command.Opts.ConnectionIdleTimeout = 1
|
||||||
assert.Equal(t, 1, manager.Cleanup())
|
assert.Equal(t, 1, manager.Cleanup())
|
||||||
assert.Equal(t, 0, manager.Len())
|
assert.Equal(t, 0, manager.Len())
|
||||||
|
assert.True(t, conn.IsClosed())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -442,6 +442,10 @@ func (client *Client) Close() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) IsClosed() bool {
|
||||||
|
return c.closed
|
||||||
|
}
|
||||||
|
|
||||||
func (client *Client) IsIdle() bool {
|
func (client *Client) IsIdle() bool {
|
||||||
mins := int(time.Since(client.lastQueryTime).Minutes())
|
mins := int(time.Since(client.lastQueryTime).Minutes())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user