(ctx context.Context)
| 140 | } |
| 141 | |
| 142 | func (om *Manager) loop(ctx context.Context) error { |
| 143 | if om.cfg.LoadPath == "" { |
| 144 | level.Info(om.logger).Log("msg", "runtime config disabled: file not specified") |
| 145 | <-ctx.Done() |
| 146 | return nil |
| 147 | } |
| 148 | |
| 149 | ticker := time.NewTicker(om.cfg.ReloadPeriod) |
| 150 | defer ticker.Stop() |
| 151 | |
| 152 | for { |
| 153 | select { |
| 154 | case <-ticker.C: |
| 155 | err := om.loadConfig(ctx) |
| 156 | if err != nil { |
| 157 | // Log but don't stop on error - we don't want to halt all ingesters because of a typo |
| 158 | level.Error(om.logger).Log("msg", "failed to load config", "err", err) |
| 159 | } |
| 160 | case <-ctx.Done(): |
| 161 | return nil |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | // loadConfig loads configuration using the loader function, and if successful, |
| 167 | // stores it as current configuration and notifies listeners. |
nothing calls this directly
no test coverage detected