MCPcopy
hub / github.com/google/seesaw / checkConfig

Method checkConfig

ha/core.go:461–486  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

459}
460
461func (n *Node) checkConfig() {
462 for {
463 failures := 0
464 var cfg *seesaw.HAConfig
465 var err error
466 for {
467 cfg, err = n.engine.HAConfig()
468 if err == nil {
469 break
470 }
471 failures++
472 log.Errorf("checkConfig: %v", err)
473 if failures > n.ConfigCheckMaxFailures {
474 n.errChannel <- fmt.Errorf("checkConfig: %d errors, giving up", failures)
475 return
476 }
477 time.Sleep(n.ConfigCheckRetryDelay)
478 }
479 if !cfg.Equal(&n.HAConfig) {
480 log.Infof("Previous HAConfig: %v", n.HAConfig)
481 log.Infof("New HAConfig: %v", *cfg)
482 n.errChannel <- fmt.Errorf("checkConfig: HAConfig has changed")
483 }
484 time.Sleep(n.ConfigCheckInterval)
485 }
486}

Callers 1

RunMethod · 0.95

Calls 2

EqualMethod · 0.95
HAConfigMethod · 0.65

Tested by

no test coverage detected