MCPcopy
hub / github.com/grafana/tempo / retentionLoop

Method retentionLoop

tempodb/retention.go:17–33  ·  view source on GitHub ↗

retentionLoop watches a timer to clean up blocks that are past retention. todo: correctly pass context all the way to the backend so a cancelled context can stop the retention loop. see implementation of compactionLoop()

(ctx context.Context)

Source from the content-addressed store, hash-verified

15// todo: correctly pass context all the way to the backend so a cancelled context can stop the retention loop.
16// see implementation of compactionLoop()
17func (rw *readerWriter) retentionLoop(ctx context.Context) {
18 ticker := time.NewTicker(rw.cfg.BlocklistPoll)
19 for {
20 select {
21 case <-ctx.Done():
22 return
23 default:
24 }
25
26 select {
27 case <-ticker.C:
28 rw.doRetention(ctx)
29 case <-ctx.Done():
30 return
31 }
32 }
33}
34
35func (rw *readerWriter) doRetention(ctx context.Context) {
36 rw.RetainWithConfig(ctx, rw.compactorCfg, rw.compactorSharder, rw.compactorOverrides)

Callers 1

EnableCompactionMethod · 0.95

Calls 2

doRetentionMethod · 0.95
DoneMethod · 0.65

Tested by

no test coverage detected