Skip to content

Commit 068712a

Browse files
authored
Merge pull request #23 from codeGROOVE-dev/star-org
Use a longer read timeout
2 parents 7b274b8 + 58ef304 commit 068712a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/client/client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ func (c *Client) sendPings(ctx context.Context, ws *websocket.Conn) {
407407

408408
// readEvents reads and processes events from the WebSocket with responsive shutdown.
409409
func (c *Client) readEvents(ctx context.Context, ws *websocket.Conn) error {
410-
// Set a short read timeout to make shutdown more responsive
411-
readTimeout := 2 * time.Second
410+
// Set read timeout to be longer than server ping interval (54s) to avoid false timeouts
411+
// Server sends pings every 54s, so we should expect a message at least that often
412+
readTimeout := 90 * time.Second
412413

413414
for {
414415
// Check for context cancellation first

0 commit comments

Comments
 (0)