(runType string, err error)
| 303 | } |
| 304 | |
| 305 | func (c *BlocksCleaner) checkRunError(runType string, err error) { |
| 306 | if err == nil { |
| 307 | level.Info(c.logger).Log("msg", fmt.Sprintf("successfully completed blocks cleanup and maintenance for %s users", runType)) |
| 308 | c.runsCompleted.WithLabelValues(runType).Inc() |
| 309 | c.runsLastSuccess.WithLabelValues(runType).SetToCurrentTime() |
| 310 | } else if errors.Is(err, context.Canceled) { |
| 311 | level.Info(c.logger).Log("msg", fmt.Sprintf("canceled blocks cleanup and maintenance for %s users", runType), "err", err) |
| 312 | } else { |
| 313 | level.Error(c.logger).Log("msg", fmt.Sprintf("failed to run blocks cleanup and maintenance for %s users", runType), "err", err.Error()) |
| 314 | c.runsFailed.WithLabelValues(runType).Inc() |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | func (c *BlocksCleaner) runEmitPartitionMetricsWorker(ctx context.Context, jobChan <-chan *cleanerJob) { |
| 319 | for job := range jobChan { |
no test coverage detected