MCPcopy Create free account
hub / github.com/cortexproject/cortex / runActiveUserCleanup

Method runActiveUserCleanup

pkg/compactor/blocks_cleaner.go:333–343  ·  view source on GitHub ↗
(ctx context.Context, jobChan <-chan *cleanerJob)

Source from the content-addressed store, hash-verified

331}
332
333func (c *BlocksCleaner) runActiveUserCleanup(ctx context.Context, jobChan <-chan *cleanerJob) {
334 for job := range jobChan {
335 if job.timestamp < time.Now().Add(-c.cfg.CleanupInterval).Unix() {
336 level.Warn(c.logger).Log("msg", "Active user cleaner job too old. Ignoring to get recent data")
337 continue
338 }
339 err := c.cleanUpActiveUsers(ctx, job.users, false)
340
341 c.checkRunError(activeStatus, err)
342 }
343}
344
345func (c *BlocksCleaner) cleanUpActiveUsers(ctx context.Context, users []string, firstRun bool) error {
346 level.Info(c.logger).Log("msg", "started blocks cleanup and maintenance for active users")

Callers 1

loopMethod · 0.95

Calls 4

cleanUpActiveUsersMethod · 0.95
checkRunErrorMethod · 0.95
AddMethod · 0.45
LogMethod · 0.45

Tested by

no test coverage detected