Sha256: 6314c0c5faa57009a4d9b17628ed95b12865f381143afa52bff24a68add85535

Contents?: true

Size: 470 Bytes

Versions: 21

Compression:

Stored size: 470 Bytes

Contents

local function delete_from_queue(queue, digest)
  local per    = 50
  local total  = redis.call("LLEN", queue)
  local index  = 0
  local result = nil

  while (index < total) do
    local items = redis.call("LRANGE", queue, index, index + per -1)
    for _, item in pairs(items) do
      if string.find(item, digest) then
        redis.call("LREM", queue, 1, item)
        result = item
        break
      end
    end
    index = index + per
  end
  return result
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-7.0.0.beta22 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta21 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta20 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta19 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta18 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta17 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta16 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta15 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta14 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta13 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta12 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta11 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta10 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta9 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta8 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta7 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta6 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta5 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta4 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua
sidekiq-unique-jobs-7.0.0.beta3 lib/sidekiq_unique_jobs/lua/shared/_delete_from_queue.lua