mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 16:58:04 +01:00
Remove a pair of spurious SET calls in the rate limiter script.
This commit is contained in:
committed by
Jon Chambers
parent
b4437d9cfd
commit
3bca856e87
@@ -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