MCPcopy Create free account
hub / github.com/coder/coder / sendBeats

Method sendBeats

enterprise/tailnet/pgcoord.go:1804–1815  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1802}
1803
1804func (h *heartbeats) sendBeats() {
1805 defer h.wg.Done()
1806 // send an initial heartbeat so that other coordinators can start using our bindings right away.
1807 h.sendBeat()
1808 close(h.firstHeartbeat) // signal binder it can start writing
1809 tkr := h.clock.TickerFunc(h.ctx, HeartbeatPeriod, func() error {
1810 h.sendBeat()
1811 return nil
1812 }, "heartbeats", "sendBeats")
1813 err := tkr.Wait()
1814 h.logger.Debug(h.ctx, "ending heartbeats", slog.Error(err))
1815}
1816
1817func (h *heartbeats) sendBeat() {
1818 _, err := h.store.UpsertTailnetCoordinator(h.ctx, h.self)

Callers 1

newHeartbeatsFunction · 0.95

Calls 4

sendBeatMethod · 0.95
WaitMethod · 0.65
DoneMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected