Fix agent panic on WebSocket disconnect #38

Merged
steve merged 2 commits from fix-issue-37-ws-disconnect-panic into main 2026-08-22 09:49:37 +01:00
Showing only changes of commit dfe082629f - Show all commits
+1 -1
View File
@@ -103,7 +103,7 @@ func connectOnce(ctx context.Context, cfg Config, handle Handler) error {
} }
dialCtx, cancel := context.WithTimeout(ctx, 30*time.Second) dialCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
conn, _, err := websocket.Dial(dialCtx, wsURL, dialOpts) conn, _, err := websocket.Dial(dialCtx, wsURL, dialOpts) //nolint:bodyclose // successful upgrades have a nil response body owned by conn
cancel() cancel()
if err != nil { if err != nil {
return fmt.Errorf("dial: %w", err) return fmt.Errorf("dial: %w", err)