mirror of https://github.com/yunginnanet/Rate5
Fix: only print if we enabled
This commit is contained in:
parent
d7d8a0ce87
commit
693cbf2c84
3
debug.go
3
debug.go
|
@ -28,8 +28,9 @@ func (q *Limiter) setDebugEvict() {
|
|||
func (q *Limiter) SetDebug(on bool) {
|
||||
switch on {
|
||||
case true:
|
||||
atomic.CompareAndSwapUint32(&q.debug, DebugDisabled, DebugEnabled)
|
||||
if atomic.CompareAndSwapUint32(&q.debug, DebugDisabled, DebugEnabled) {
|
||||
q.debugPrintf("rate5 debug enabled")
|
||||
}
|
||||
case false:
|
||||
atomic.CompareAndSwapUint32(&q.debug, DebugEnabled, DebugDisabled)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue