config reads the HAConfig from the engine. It does not return until it successfully retrieves an HAConfig that has HA peering enabled.
(e ha.Engine)
| 79 | // config reads the HAConfig from the engine. It does not return until it |
| 80 | // successfully retrieves an HAConfig that has HA peering enabled. |
| 81 | func config(e ha.Engine) *seesaw.HAConfig { |
| 82 | for { |
| 83 | c, err := e.HAConfig() |
| 84 | switch { |
| 85 | case err != nil: |
| 86 | log.Errorf("config: Failed to retrieve HAConfig: %v", err) |
| 87 | |
| 88 | case !c.Enabled: |
| 89 | log.Infof("config: HA peering is currently disabled for this node") |
| 90 | |
| 91 | default: |
| 92 | return c |
| 93 | } |
| 94 | time.Sleep(*initConfigRetryDelay) |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func engine() ha.Engine { |
| 99 | if *testMode { |