Sha256: a99c5f6103d678e1790a32d45884330f6bc4c957738b760d07c3254ad22f1905

Contents?: true

Size: 320 Bytes

Versions: 41

Compression:

Stored size: 320 Bytes

Contents

local key = KEYS[1]
local lmt = tonumber(ARGV[1])
local ttl = tonumber(ARGV[2])
local now = tonumber(ARGV[3])

if lmt <= redis.call("LLEN", key) and now - redis.call("LINDEX", key, -1) < ttl then
  return 1
end

redis.call("LPUSH", key, now)
redis.call("LTRIM", key, 0, lmt - 1)
redis.call("EXPIRE", key, ttl)

return 0

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
sidekiq-throttled-1.5.2 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.5.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.5.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.4.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.3.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.2.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.1.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.0.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.0.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.0.0.alpha.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-1.0.0.alpha lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.15.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.18.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.17.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.16.2 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.16.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.16.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.15.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.14.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.13.0 lib/sidekiq/throttled/strategy/threshold.lua