mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
15 lines
227 B
Go
15 lines
227 B
Go
|
|
package erratic
|
||
|
|
|
||
|
|
import (
|
||
|
|
"sync/atomic"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Health implements the health.Healther interface.
|
||
|
|
func (e *Erratic) Health() bool {
|
||
|
|
q := atomic.LoadUint64(&e.q)
|
||
|
|
if e.drop > 0 && q%e.drop == 0 {
|
||
|
|
return false
|
||
|
|
}
|
||
|
|
return true
|
||
|
|
}
|