clusterWait returns a function that inspects the current peer state and returns a duration of one base timeout for each peer with a higher ID than ourselves.
(position func() int, timeout time.Duration)
| 346 | // clusterWait returns a function that inspects the current peer state and returns |
| 347 | // a duration of one base timeout for each peer with a higher ID than ourselves. |
| 348 | func clusterWait(position func() int, timeout time.Duration) func() time.Duration { |
| 349 | return func() time.Duration { |
| 350 | return time.Duration(position()) * timeout |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | // ApplyConfig applies a new configuration to an Alertmanager. |
| 355 | func (am *Alertmanager) ApplyConfig(userID string, conf *config.Config, rawCfg string) error { |