mirror of https://github.com/yunginnanet/Rate5
Compare commits
2 Commits
d7d8a0ce87
...
d51b3642b8
Author | SHA1 | Date | |
---|---|---|---|
kayos@tcp.direct | d51b3642b8 | ||
kayos@tcp.direct | 693cbf2c84 |
|
@ -1,6 +1,6 @@
|
|||
# Rate5
|
||||
[![GoDoc](https://godoc.org/github.com/yunginnanet/?status.svg)](https://godoc.org/github.com/yunginnanet/Rate5) [![Go Report Card](https://goreportcard.com/badge/github.com/yunginnanet/Rate5)](https://goreportcard.com/report/github.com/yunginnanet/Rate5) [![Go](https://github.com/yunginnanet/Rate5/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/yunginnanet/Rate5/actions/workflows/go.yml)
|
||||
[![codecov](https://codecov.io/gh/yunginnanet/Rate5/branch/main/graph/badge.svg?token=R7WU58G5L7)](https://codecov.io/gh/yunginnanet/Rate5)
|
||||
[![codecov](https://codecov.io/gh/yunginnanet/Rate5/branch/main/graph/badge.svg?token=R7WU58G5L7)](https://codecov.io/gh/yunginnanet/Rate5) ![five](https://img.shields.io/badge/fhjones-55555-blue)
|
||||
|
||||
A performant and generic ratelimitter for any golang project.
|
||||
|
||||
|
|
5
debug.go
5
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)
|
||||
q.debugPrintf("rate5 debug enabled")
|
||||
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