(ctx context.Context)
| 175 | } |
| 176 | |
| 177 | func (om *Manager) loop(ctx context.Context) error { |
| 178 | if len(om.cfg.LoadPath) == 0 { |
| 179 | level.Info(om.logger).Log("msg", "runtime config disabled: file not specified") |
| 180 | <-ctx.Done() |
| 181 | return nil |
| 182 | } |
| 183 | |
| 184 | ticker := time.NewTicker(om.cfg.ReloadPeriod) |
| 185 | defer ticker.Stop() |
| 186 | |
| 187 | for { |
| 188 | select { |
| 189 | case <-ticker.C: |
| 190 | err := om.loadConfig(ctx) |
| 191 | if err != nil { |
| 192 | // Log but don't stop on error - we don't want to halt all ingesters because of a typo |
| 193 | level.Error(om.logger).Log("msg", "failed to load config", "err", err) |
| 194 | } |
| 195 | case <-ctx.Done(): |
| 196 | return nil |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | // loadConfig loads all configuration files using the loader function then merges the yaml configuration files into one yaml document. |
| 202 | // and notifies listeners if successful. |
nothing calls this directly
no test coverage detected