Sha256: 96b8208b6d24bdf5cf9f77c3e9a602ee8119acf89857da291ce33b9c3366b1b3

Contents?: true

Size: 679 Bytes

Versions: 84

Compression:

Stored size: 679 Bytes

Contents

local function add_bids(root, depth)
    local result_data = {}

    if depth > 0 then
        local sbids
        if depth == tonumber(ARGV[2]) and ARGV[4] then
            local min, max = ARGV[4]:match('(%d+):(%d+)')
            sbids = redis.call('ZRANGE', 'BID-' .. root .. '-bids', min, max)
        else
            sbids = redis.call('ZRANGE', 'BID-' .. root .. '-bids', 0, tonumber(ARGV[3]) - 1)
        end

        local sub_data = {}
        for _,v in ipairs(sbids) do
            table.insert(sub_data, add_bids(v, depth - 1))
        end

        return { root, sub_data }
    end

    return { root, result_data}
end

return add_bids(ARGV[1], tonumber(ARGV[2]))

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
canvas_sync-0.21.0.beta5 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.21.0.beta4 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.21.0.beta3 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.21.0.beta2 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.21.0.beta1 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.20.5 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.20.4 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.20.3 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.1.beta2 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.1.beta1 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta10 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta9 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta8 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta7 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta6 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta5 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta4 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta3 lib/canvas_sync/job_batches/hier_batch_ids.lua
canvas_sync-0.19.0.beta2 lib/canvas_sync/job_batches/hier_batch_ids.lua