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

Method updateServices

engine/vserver.go:1194–1212  ·  view source on GitHub ↗

updateServices brings the services for a vserver up or down based on the state of the vserver and the health of each service.

(ip seesaw.IP)

Source from the content-addressed store, hash-verified

1192// updateServices brings the services for a vserver up or down based on the
1193// state of the vserver and the health of each service.
1194func (v *vserver) updateServices(ip seesaw.IP) {
1195 for _, s := range v.services {
1196 if !s.ip.Equal(ip) {
1197 continue
1198 }
1199 if !v.active[ip] {
1200 if s.active {
1201 s.down()
1202 }
1203 continue
1204 }
1205 switch {
1206 case !s.healthy && s.active:
1207 s.down()
1208 case s.healthy && !s.active:
1209 s.up()
1210 }
1211 }
1212}
1213
1214// up brings up all healthy services for an IP address for a vserver, then
1215// brings up the IP address.

Callers 3

updateStateMethod · 0.95
upMethod · 0.95
downMethod · 0.95

Calls 3

downMethod · 0.95
upMethod · 0.95
EqualMethod · 0.45

Tested by

no test coverage detected