Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit d48420e

Browse files
committed
Add connection close code to log
1 parent aadc374 commit d48420e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/connection.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ func NewConnection(ctx context.Context, wsURL string, logger *Logger) (*Connecti
153153
// closeConnection cleanly closes the WebSocket connection.
154154
// Returns an error if sending the close control frame fails.
155155
func (c *Connection) closeConnection(code int) error {
156-
var err error
156+
c.logger.Debugf("Connection:closeConnection", "code:%d", code)
157157

158+
var err error
158159
c.shutdownOnce.Do(func() {
159160
defer func() {
160161
_ = c.conn.Close()
@@ -234,6 +235,7 @@ func (c *Connection) handleIOError(err error) {
234235
func (c *Connection) getSession(id target.SessionID) *Session {
235236
c.sessionsMu.RLock()
236237
defer c.sessionsMu.RUnlock()
238+
237239
return c.sessions[id]
238240
}
239241

0 commit comments

Comments
 (0)