ForceUpdate runs a single health check and updates the cache. If the health check fails, the cache is not updated and an error is returned. This is useful to trigger an update when a proxy is created or deleted.
(ctx context.Context)
| 162 | // check fails, the cache is not updated and an error is returned. This is useful |
| 163 | // to trigger an update when a proxy is created or deleted. |
| 164 | func (p *ProxyHealth) ForceUpdate(ctx context.Context) error { |
| 165 | statuses, err := p.runOnce(ctx, time.Now()) |
| 166 | if err != nil { |
| 167 | return err |
| 168 | } |
| 169 | |
| 170 | p.storeProxyHealth(statuses) |
| 171 | return nil |
| 172 | } |
| 173 | |
| 174 | // HealthStatus returns the current health status of all proxies stored in the |
| 175 | // cache. |