MCPcopy
hub / github.com/cortexlabs/cortex / handleConnection

Function handleConnection

cli/cluster/logs.go:139–150  ·  view source on GitHub ↗
(connection *websocket.Conn, done chan struct{})

Source from the content-addressed store, hash-verified

137}
138
139func handleConnection(connection *websocket.Conn, done chan struct{}) {
140 routines.RunWithPanicHandler(func() {
141 defer close(done)
142 for {
143 _, message, err := connection.ReadMessage()
144 if err != nil {
145 exit.Error(ErrorOperatorSocketRead(err))
146 }
147 fmt.Print(string(message))
148 }
149 }, false)
150}
151
152func closeConnection(connection *websocket.Conn, done chan struct{}, interrupt chan os.Signal) {
153 for {

Callers 1

streamLogsFunction · 0.85

Calls 4

RunWithPanicHandlerFunction · 0.92
ErrorFunction · 0.92
ErrorOperatorSocketReadFunction · 0.85
PrintMethod · 0.45

Tested by

no test coverage detected