Sha256: abc1cebb91d619ec9de8fccc9c8f2448d84254b2b8e0ad25cc8a1ef30bcb53e0

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

-- This gets all the data associated with the job with the
-- provided id.
--
-- Args:
--    1) jid

if #KEYS > 0 then error('Get(): No Keys should be provided') end

local jid = assert(ARGV[1], 'Get(): Arg "jid" missing')

-- Let's get all the data we can
local job = redis.call(
    'hmget', 'ql:j:' .. jid, 'jid', 'klass', 'state', 'queue', 'worker', 'priority',
	'expires', 'retries', 'remaining', 'data', 'tags', 'history', 'failure')

if not job[1] then
	return false
end
		
return cjson.encode({
    jid          = job[1],
	klass        = job[2],
    state        = job[3],
    queue        = job[4],
	worker       = job[5] or '',
	tracked      = redis.call('zscore', 'ql:tracked', jid) ~= false,
	priority     = tonumber(job[6]),
	expires      = tonumber(job[7]) or 0,
	retries      = tonumber(job[8]),
	remaining    = tonumber(job[9]),
	data         = cjson.decode(job[10]),
	tags         = cjson.decode(job[11]),
    history      = cjson.decode(job[12]),
	failure      = cjson.decode(job[13] or '{}'),
	dependents   = redis.call('smembers', 'ql:j:' .. jid .. '-dependents'),
	dependencies = redis.call('smembers', 'ql:j:' .. jid .. '-dependencies')
})

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qless-0.9.3 lib/qless/qless-core/get.lua
qless-0.9.2 lib/qless/qless-core/get.lua
qless-0.9.1 lib/qless/qless-core/get.lua