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

Method handleCheckNotification

engine/vserver.go:739–760  ·  view source on GitHub ↗

handleCheckNotification processes a checkNotification, bringing destinations, services, and vservers up or down appropriately.

(n *checkNotification)

Source from the content-addressed store, hash-verified

737// handleCheckNotification processes a checkNotification, bringing
738// destinations, services, and vservers up or down appropriately.
739func (v *vserver) handleCheckNotification(n *checkNotification) {
740 if !v.enabled {
741 log.Infof("%v: ignoring healthcheck notification %s (vserver disabled)", v, n.description)
742 return
743 }
744
745 check := v.checks[n.key]
746 if check == nil {
747 log.Warningf("%v: unknown check key %v", v, n.key)
748 return
749 }
750
751 transition := (check.status.State != n.status.State)
752 check.description = n.description
753 check.status = n.status
754 if transition {
755 log.Infof("%v: healthcheck %s - %v (%s)", v, n.description, n.status.State, n.status.Message)
756 for _, d := range check.dests {
757 d.updateState()
758 }
759 }
760}
761
762// handleOverride processes an Override.
763func (v *vserver) handleOverride(o seesaw.Override) {

Callers 7

runMethod · 0.95
TestWatermarksFunction · 0.80
TestDisableVserverFunction · 0.80
TestVserverOverrideFunction · 0.80
TestUpdateVserverFunction · 0.80
TestReIPVserverFunction · 0.80

Calls 1

updateStateMethod · 0.45

Tested by 6

TestWatermarksFunction · 0.64
TestDisableVserverFunction · 0.64
TestVserverOverrideFunction · 0.64
TestUpdateVserverFunction · 0.64
TestReIPVserverFunction · 0.64