MCPcopy Index your code
hub / github.com/coder/coder / pingWithTimeout

Function pingWithTimeout

coderd/httpapi/websocket.go:66–75  ·  view source on GitHub ↗
(ctx context.Context, conn *websocket.Conn, timeout time.Duration)

Source from the content-addressed store, hash-verified

64}
65
66func pingWithTimeout(ctx context.Context, conn *websocket.Conn, timeout time.Duration) error {
67 ctx, cancel := context.WithTimeout(ctx, timeout)
68 defer cancel()
69 err := conn.Ping(ctx)
70 if err != nil {
71 return xerrors.Errorf("failed to ping: %w", err)
72 }
73
74 return nil
75}

Callers 1

heartbeatCloseWithFunction · 0.85

Calls 2

PingMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected