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

Method heartbeatLoop

coderd/x/chatd/chatd.go:4834–4845  ·  view source on GitHub ↗

heartbeatLoop runs in a single goroutine, issuing one batch heartbeat query per interval for all registered chats.

(ctx context.Context)

Source from the content-addressed store, hash-verified

4832// heartbeatLoop runs in a single goroutine, issuing one batch
4833// heartbeat query per interval for all registered chats.
4834func (p *Server) heartbeatLoop(ctx context.Context) {
4835 ticker := p.clock.NewTicker(p.chatHeartbeatInterval, "chatd", "batch-heartbeat")
4836 defer ticker.Stop()
4837 for {
4838 select {
4839 case <-ctx.Done():
4840 return
4841 case <-ticker.C:
4842 p.heartbeatTick(ctx)
4843 }
4844 }
4845}
4846
4847// heartbeatTick issues a single batch UPDATE for all running chats
4848// owned by this worker. Chats missing from the result set are

Callers 1

NewFunction · 0.95

Calls 3

heartbeatTickMethod · 0.95
StopMethod · 0.65
DoneMethod · 0.45

Tested by

no test coverage detected