Monorepo for Tangled tangled.org

spindle/stream: add keep alive ping to log streaming. #780

merged opened by evan.jarrett.net targeting master from evan.jarrett.net/core: spindle
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:pddp4xt5lgnv2qsegbzzs4xg/sh.tangled.repo.pull/3m5c67i77ep22
+5
Diff #2
+5
spindle/stream.go
··· 213 213 if err := conn.WriteMessage(websocket.TextMessage, []byte(line.Text)); err != nil { 214 214 return fmt.Errorf("failed to write to websocket: %w", err) 215 215 } 216 + case <-time.After(30 * time.Second): 217 + // send a keep-alive 218 + if err := conn.WriteControl(websocket.PingMessage, []byte{}, time.Now().Add(time.Second)); err != nil { 219 + return fmt.Errorf("failed to write control: %w", err) 220 + } 216 221 } 217 222 } 218 223 }

History

3 rounds 1 comment
sign up or login to add to the discussion
1 commit
expand
spindle/stream: add keep alive ping to log streaming.
expand 1 comment

lgtm thanks!

pull request successfully merged
1 commit
expand
spindle/stream: add keep alive ping to log streaming.
expand 0 comments
1 commit
expand
spindle/stream: add keep alive ping to log streaming.
expand 0 comments