HealthCheck returns whether the server is ready to accept requests or not Load balancer would add the node to the endpoint once health check starts returning true
()
| 52 | // Load balancer would add the node to the endpoint once health check starts |
| 53 | // returning true |
| 54 | func HealthCheck() error { |
| 55 | if atomic.LoadUint32(&healthCheck) == 0 { |
| 56 | return errHealth |
| 57 | } |
| 58 | if atomic.LoadUint32(&drainingMode) == 1 { |
| 59 | return errDrainingMode |
| 60 | } |
| 61 | return nil |
| 62 | } |
| 63 | |
| 64 | func setStatus(v *uint32, ok bool) { |
| 65 | if ok { |
no outgoing calls
no test coverage detected