MCPcopy
hub / github.com/dgraph-io/dgraph / HealthCheck

Function HealthCheck

x/health.go:54–62  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

52// Load balancer would add the node to the endpoint once health check starts
53// returning true
54func 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
64func setStatus(v *uint32, ok bool) {
65 if ok {

Callers 12

validateAlterOperationFunction · 0.92
doQueryMethod · 0.92
CommitOrAbortMethod · 0.92
CheckVersionMethod · 0.92
LoginMethod · 0.92
healthCheckFunction · 0.92
setupServerFunction · 0.92
ProcessBackupRequestFunction · 0.92
ExportOverNetworkFunction · 0.92
ServeTaskMethod · 0.92
MovePredicateMethod · 0.92
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected