Evict connection pool entry on logout
This commit is contained in:
parent
c62703985e
commit
85f8530fd3
1 changed files with 6 additions and 0 deletions
|
@ -54,5 +54,11 @@ func (pool *ConnPool) Put(conn *imapclient.Client) (token string, err error) {
|
|||
}
|
||||
|
||||
pool.conns[token] = conn
|
||||
|
||||
go func() {
|
||||
<-conn.LoggedOut()
|
||||
delete(pool.conns, token)
|
||||
}()
|
||||
|
||||
return token, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue