mirror of
https://github.com/yunginnanet/Rate5
synced 2024-06-16 12:08:41 +00:00
Compare commits
2 Commits
d7d8a0ce87
...
d51b3642b8
Author | SHA1 | Date | |
---|---|---|---|
d51b3642b8 | |||
693cbf2c84 |
@ -1,6 +1,6 @@
|
|||||||
# Rate5
|
# 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)
|
[![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.
|
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) {
|
func (q *Limiter) SetDebug(on bool) {
|
||||||
switch on {
|
switch on {
|
||||||
case true:
|
case true:
|
||||||
atomic.CompareAndSwapUint32(&q.debug, DebugDisabled, DebugEnabled)
|
if atomic.CompareAndSwapUint32(&q.debug, DebugDisabled, DebugEnabled) {
|
||||||
q.debugPrintf("rate5 debug enabled")
|
q.debugPrintf("rate5 debug enabled")
|
||||||
|
}
|
||||||
case false:
|
case false:
|
||||||
atomic.CompareAndSwapUint32(&q.debug, DebugEnabled, DebugDisabled)
|
atomic.CompareAndSwapUint32(&q.debug, DebugEnabled, DebugDisabled)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user