1
0
mirror of https://github.com/coalaura/up.git synced 2025-07-17 21:44:35 +00:00

cleanup empty

This commit is contained in:
Laura
2025-06-20 23:24:49 +02:00
parent c7d01ae844
commit 7e216984c5

View File

@ -49,7 +49,11 @@ func (rl *RateLimiter) Inc(key string) (uint32, func(), func()) {
} }
rl.total.Add(MinusOne) rl.total.Add(MinusOne)
val.Add(MinusOne)
if val.Add(MinusOne) == 0 {
// potential race, but ok
rl.Map.Delete(key)
}
} }
return new, pass, fail return new, pass, fail