Sha256: f2e145478fa62448830f0afcc1d98a04c389a5550bfb2bf9cceedea606906079

Contents?: true

Size: 260 Bytes

Versions: 9

Compression:

Stored size: 260 Bytes

Contents

local r, k, l, p, t = redis, KEYS[1], tonumber(ARGV[1]), tonumber(ARGV[2]), tonumber(ARGV[3])
if l <= r.call("LLEN", k) and t - r.call("LINDEX", k, -1) < p then return 1 end
r.call("LPUSH", k, t); r.call("LTRIM", k, 0, l - 1); r.call("EXPIRE", k, p); return 0

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sidekiq-throttled-0.4.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.5.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.4.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.3.2 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.3.1 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.3.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.3.0.pre lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.2.0 lib/sidekiq/throttled/strategy/threshold.lua
sidekiq-throttled-0.1.0 lib/sidekiq/throttled/strategy/threshold.lua