(statuses map[uuid.UUID]ProxyStatus)
| 146 | } |
| 147 | |
| 148 | func (p *ProxyHealth) storeProxyHealth(statuses map[uuid.UUID]ProxyStatus) { |
| 149 | var proxyHosts []*agplproxyhealth.ProxyHost |
| 150 | for _, s := range statuses { |
| 151 | if s.ProxyHost != nil { |
| 152 | proxyHosts = append(proxyHosts, s.ProxyHost) |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | // Store the statuses in the cache before any other quick values. |
| 157 | p.cache.Store(&statuses) |
| 158 | p.proxyHosts.Store(&proxyHosts) |
| 159 | } |
| 160 | |
| 161 | // ForceUpdate runs a single health check and updates the cache. If the health |
| 162 | // check fails, the cache is not updated and an error is returned. This is useful |
no test coverage detected