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

Function HeartbeatCloseWithClock

coderd/httpapi/websocket.go:26–28  ·  view source on GitHub ↗

HeartbeatCloseWithClock is like HeartbeatClose, but uses the provided clock so tests can drive heartbeat ticks deterministically.

(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn, clk quartz.Clock)

Source from the content-addressed store, hash-verified

24// HeartbeatCloseWithClock is like HeartbeatClose, but uses the provided
25// clock so tests can drive heartbeat ticks deterministically.
26func HeartbeatCloseWithClock(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn, clk quartz.Clock) {
27 heartbeatCloseWith(ctx, logger, exit, conn, clk, HeartbeatInterval)
28}
29
30func heartbeatCloseWith(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn, clk quartz.Clock, interval time.Duration) {
31 ticker := clk.NewTicker(interval, "HeartbeatClose")

Callers 1

Calls 1

heartbeatCloseWithFunction · 0.85

Tested by

no test coverage detected