1
0
mirror of https://github.com/coalaura/up.git synced 2025-09-08 13:29:54 +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)
val.Add(MinusOne)
if val.Add(MinusOne) == 0 {
// potential race, but ok
rl.Map.Delete(key)
}
}
return new, pass, fail