1
2
mirror of https://github.com/yunginnanet/Rate5 synced 2024-06-20 22:18:33 +00:00

Fix Refactor (perf): bad type assertion

This commit is contained in:
kayos@tcp.direct 2024-02-06 23:52:25 -08:00
parent 598aa983e8
commit 953ca476b5
Signed by: kayos
GPG Key ID: 4B841471B4BEE979

@ -164,7 +164,7 @@ func (q *Limiter) Check(from Identity) (limited bool) {
func (q *Limiter) Peek(from Identity) bool {
q.Patrons.DeleteExpired()
if ct, ok := q.Patrons.Get(from.UniqueKey()); ok {
count := ct.(int64)
count := ct.(*atomic.Int64).Load()
if count > q.Ruleset.Burst {
return true
}