mirror of
https://github.com/coalaura/up.git
synced 2025-07-17 21:44:35 +00:00
cleanup empty
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user