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

Method cleanupLoop

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

Source from the content-addressed store, hash-verified

1837}
1838
1839func (h *heartbeats) cleanupLoop() {
1840 defer h.wg.Done()
1841 h.cleanup()
1842 tkr := h.clock.TickerFunc(h.ctx, cleanupPeriod, func() error {
1843 h.cleanup()
1844 return nil
1845 }, "heartbeats", "cleanupLoop")
1846 err := tkr.Wait()
1847 h.logger.Debug(h.ctx, "ending cleanupLoop", slog.Error(err))
1848}
1849
1850// cleanup issues a DB command to clean out any old expired coordinators or lost peer state. The
1851// cleanup is idempotent, so no need to synchronize with other coordinators.

Callers 2

TestHeartbeats_CleanupFunction · 0.95
newHeartbeatsFunction · 0.95

Calls 4

cleanupMethod · 0.95
WaitMethod · 0.65
DoneMethod · 0.45
ErrorMethod · 0.45

Tested by 1

TestHeartbeats_CleanupFunction · 0.76