Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Proxyhealth is an enterprise feature
  • Loading branch information
Emyrk committed Apr 20, 2023
commit 3d48d32b692576c561a5be33bacac88e57c8e623
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ func New(opts *Options) (*ProxyHealth, error) {
}, nil
}

// Run will block until the context is canceled. It will periodically check the
// health of all proxies and store the results in the cache.
func (p *ProxyHealth) Run(ctx context.Context) {
ticker := time.NewTicker(p.interval)
defer ticker.Stop()
Expand Down Expand Up @@ -111,6 +113,8 @@ func (p *ProxyHealth) ForceUpdate(ctx context.Context) error {
return nil
}

// HealthStatus returns the current health status of all proxies stored in the
// cache.
func (p *ProxyHealth) HealthStatus() map[uuid.UUID]ProxyStatus {
ptr := p.cache.Load()
if ptr == nil {
Expand Down