handleCheckNotification processes a checkNotification, bringing destinations, services, and vservers up or down appropriately.
(n *checkNotification)
| 737 | // handleCheckNotification processes a checkNotification, bringing |
| 738 | // destinations, services, and vservers up or down appropriately. |
| 739 | func (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. |
| 763 | func (v *vserver) handleOverride(o seesaw.Override) { |