HAUpdate advises the Engine of the current high-availability status for the Seesaw HA component. The Seesaw Engine may also request a failover in response.
(args *ipc.HAStatus, failover *bool)
| 110 | // the Seesaw HA component. The Seesaw Engine may also request a failover |
| 111 | // in response. |
| 112 | func (s *SeesawEngine) HAUpdate(args *ipc.HAStatus, failover *bool) error { |
| 113 | if args == nil { |
| 114 | return errors.New("args is nil") |
| 115 | } |
| 116 | ctx := args.Ctx |
| 117 | s.trace("HAUpdate", ctx) |
| 118 | if ctx == nil { |
| 119 | return errContext |
| 120 | } |
| 121 | |
| 122 | if !ctx.IsTrusted() { |
| 123 | return errAccess |
| 124 | } |
| 125 | |
| 126 | if err := s.engine.setHAStatus(args.Status); err != nil { |
| 127 | return err |
| 128 | } |
| 129 | if failover != nil { |
| 130 | *failover = s.engine.haManager.failover() |
| 131 | } |
| 132 | return nil |
| 133 | } |
| 134 | |
| 135 | // HAState advises the Engine of the current high-availability state as |
| 136 | // determined by the Seesaw HA component. |
nothing calls this directly
no test coverage detected