Evict connection pool entry on logout

This commit is contained in:
Simon Ser 2019-12-02 17:36:43 +01:00
parent c62703985e
commit 85f8530fd3
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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
}