Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion protocol/logger/job_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,25 @@ func (logger *WebsocketLivelogger) Connect() error {
ctx, cancel := context.WithTimeout(context.Background(), websocketDialTimeout)
defer cancel()
//nolint:bodyclose // websocket.Dial doesn't return an HTTP response body to close
logger.ws, _, err = websocket.Dial(ctx, feedStreamURL.String(), &websocket.DialOptions{
ws, _, err := websocket.Dial(ctx, feedStreamURL.String(), &websocket.DialOptions{
HTTPClient: logger.Connection.HTTPClient(),
HTTPHeader: http.Header{
"Authorization": []string{"Bearer " + logger.Connection.Token},
"User-Agent": []string{"github-act-runner/1.0.0"},
},
})
// While reconnecting never assign this to null
if ws != nil {
logger.ws = ws
}
return err
}

func (logger *WebsocketLivelogger) SendLog(lines *protocol.TimelineRecordFeedLinesWrapper) error {
// Do not try to send if something is wrong
if logger.ws == nil {
return fmt.Errorf("missing websocket connection")
}
ctx, cancel := context.WithTimeout(context.Background(), websocketMessageTimeout)
defer cancel()
return wsjson.Write(ctx, logger.ws, lines)
Expand Down
1 change: 0 additions & 1 deletion runnersurvey.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux || darwin || windows || openbsd || netbsd || freebsd
// +build linux darwin windows openbsd netbsd freebsd

package main

Expand Down
1 change: 0 additions & 1 deletion runnersurveyunsupported.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !linux && !darwin && !windows && !openbsd && !netbsd && !freebsd
// +build !linux,!darwin,!windows,!openbsd,!netbsd,!freebsd

package main

Expand Down