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

Method runDeleteUserCleanup

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

Source from the content-addressed store, hash-verified

366}
367
368func (c *BlocksCleaner) runDeleteUserCleanup(ctx context.Context, jobChan chan *cleanerJob) {
369 for job := range jobChan {
370 if job.timestamp < time.Now().Add(-c.cfg.CleanupInterval).Unix() {
371 level.Warn(c.logger).Log("Delete users cleaner job too old. Ignoring to get recent data")
372 continue
373 }
374 err := c.cleanDeletedUsers(ctx, job.users)
375
376 c.checkRunError(deletedStatus, err)
377 }
378}
379
380func (c *BlocksCleaner) cleanDeletedUsers(ctx context.Context, users []string) error {
381 level.Info(c.logger).Log("msg", "started blocks cleanup and maintenance for deleted users")

Callers 1

loopMethod · 0.95

Calls 4

cleanDeletedUsersMethod · 0.95
checkRunErrorMethod · 0.95
AddMethod · 0.45
LogMethod · 0.45

Tested by

no test coverage detected