mirror of
https://github.com/axllent/mailpit.git
synced 2026-06-27 22:46:09 +00:00
Chore: Ensure websocket connection is closed on client unregistration
This commit is contained in:
@@ -56,6 +56,7 @@ type Client struct {
|
||||
func (c *Client) readPump() {
|
||||
defer func() {
|
||||
c.hub.unregister <- c
|
||||
c.conn.Close()
|
||||
}()
|
||||
|
||||
for {
|
||||
@@ -79,6 +80,7 @@ func (c *Client) writePump() {
|
||||
defer func() {
|
||||
ticker.Stop()
|
||||
c.hub.unregister <- c
|
||||
c.conn.Close()
|
||||
}()
|
||||
for {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user