mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-15 03:36:33 +03:00
Verify client is closed
This commit is contained in:
parent
bc54c95140
commit
73dfcc46c3
@ -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())
|
||||
})
|
||||
}
|
||||
|
@ -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())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user