Sha256: b84e01c7e0919159cb46a538cd1e37e570efca526e709159c53afc72c91ab5ef

Contents?: true

Size: 315 Bytes

Versions: 2

Compression:

Stored size: 315 Bytes

Contents

local result = {{},{}}
local active  = redis.pcall('SMEMBERS', KEYS[1])

for _, v in pairs(active) do
   local exists = tonumber(redis.pcall('EXISTS', v))
   if exists == 0 then
      table.insert(result[1], v)
      redis.pcall('SREM', KEYS[1], v)
   else
      table.insert(result[2], v)
   end
end
return result

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simpleworker-0.1.1 lib/simpleworker/scripts/expired_tasks.lua
simpleworker-0.1.0 lib/simpleworker/scripts/expired_tasks.lua