mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 05:06:47 +00:00
Remove a pair of spurious SET calls in the rate limiter script.
This commit is contained in:
1 parent
b4437d9cfd
commit
3bca856e87
1 file changed
-3
@@ -21,9 +21,6 @@ end
|
||||
local elapsedTime = currentTimeMillis - leakyBucket["lastUpdateTimeMillis"]
|
||||
local updatedSpaceRemaining = math.min(leakyBucket["bucketSize"], math.floor(leakyBucket["spaceRemaining"] + (elapsedTime * leakyBucket["leakRatePerMillis"])))
|
||||
|
||||
redis.call("SET", "elapsedTime", elapsedTime)
|
||||
redis.call("SET", "updatedSpaceRemaining", updatedSpaceRemaining)
|
||||
|
||||
if updatedSpaceRemaining >= amount then
|
||||
leakyBucket["spaceRemaining"] = updatedSpaceRemaining - amount
|
||||
redis.call("SET", bucketId, cjson.encode(leakyBucket))
|
||||
|
||||
Reference in new issue
Block a user