Sha256: c1aa1699872ae7798d230c1750c0259de75ae7de20178d57c270aa33f13efa6f

Contents?: true

Size: 866 Bytes

Versions: 53

Compression:

Stored size: 866 Bytes

Contents

local hmset = function (key, dict)
  if next(dict) == nil then return nil end
  local bulk = {}
  for k, v in pairs(dict) do
    table.insert(bulk, k)
    table.insert(bulk, v)
  end
  return redis.call('HMSET', key, unpack(bulk))
end
local payload = cjson.decode(redis.call('get', (KEYS[1])))
local ttl = payload.ttl
local files_data = payload.files_data
redis.call('DEL', KEYS[1])
for _, file_data in ipairs(files_data) do

  local hash_key = file_data.hash_key
  local first_updated_at = file_data.meta.first_updated_at
  file_data.meta.first_updated_at = nil

  hmset(hash_key, file_data.meta)
  redis.call('HSETNX', hash_key, 'first_updated_at', first_updated_at)
  for line, coverage in pairs(file_data.coverage) do
    redis.call("HINCRBY", hash_key, line, coverage)
  end
  if ttl and ttl ~= cjson.null then
    redis.call("EXPIRE", hash_key, ttl)
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
coverband-6.0.3.rc.4 lua/lib/persist-coverage.lua
coverband-6.0.3.rc.3 lua/lib/persist-coverage.lua
coverband-6.0.3.rc.2 lua/lib/persist-coverage.lua
coverband-6.0.3.rc.1 lua/lib/persist-coverage.lua
coverband-6.0.2 lua/lib/persist-coverage.lua
coverband-6.0.1 lua/lib/persist-coverage.lua
coverband-6.0.1.rc.1 lua/lib/persist-coverage.lua
coverband-6.0.0 lua/lib/persist-coverage.lua
coverband-5.2.6.rc.6 lua/lib/persist-coverage.lua
coverband-5.2.3.2 lua/lib/persist-coverage.lua
coverband-5.2.6.rc.5 lua/lib/persist-coverage.lua
coverband-5.2.3.1 lua/lib/persist-coverage.lua
coverband-5.2.6.rc.4 lua/lib/persist-coverage.lua
coverband-5.2.6.rc.3 lua/lib/persist-coverage.lua
coverband-5.2.6.rc.2 lua/lib/persist-coverage.lua
coverband-5.2.6.rc.1 lua/lib/persist-coverage.lua
coverband-5.2.5 lua/lib/persist-coverage.lua
coverband-5.2.5.rc.3 lua/lib/persist-coverage.lua
coverband-5.2.5.rc.2 lua/lib/persist-coverage.lua
coverband-5.2.5.rc.1 lua/lib/persist-coverage.lua