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