func (health *Health) Healthy() bool {
	start := time.Now()

	for time.Since(start) < time.Second {
		if atomic.CompareAndSwapUint32(&health.locker, 0, 1) {
			defer atomic.StoreUint32(&health.locker, 0)
			return time.Since(health.updated) < health.timeout
		}

		time.Sleep(50 * time.Millisecond)
	}

	return false
}
// Healthy returns health status based on last update timestamp
Healthy returns health status based on last update timestamp
// Healthy returns health status based on last update timestamp
func (health *Health) Healthy() bool {
	start := time.Now()
	for time.Since(start) < time.Second {
		if atomic.CompareAndSwapUint32(&health.locker, 0, 1) {
			defer atomic.StoreUint32(&health.locker, 0)
			return time.Since(health.updated) < health.timeout
		}
		time.Sleep(50 * time.Millisecond)
	}
	return false
}
func ( health * Health ) Healthy ( ) bool { start := time . Now ( ) for time . Since ( start ) < time . Second { if atomic . CompareAndSwapUint32 ( & health . locker , 0 , 1 ) { defer atomic . StoreUint32 ( & health . locker , 0 ) return time . Since ( health . updated ) < health . timeout } time . Sleep ( 50 * time . Millisecond ) } return false }
Healthy returns health status based on last update timestamp
Healthy returns health status based on last update timestamp