getTimestamp.lua 348 B

12345678910111213141516171819
  1. --[[
  2. Function to get the latest saved timestamp.
  3. ]]
  4. local function getTimestamp(jobKey, attributes)
  5. if #attributes == 1 then
  6. return rcall("HGET", jobKey, attributes[1])
  7. end
  8. local jobTs
  9. for _, ts in ipairs(rcall("HMGET", jobKey, unpack(attributes))) do
  10. if (ts) then
  11. jobTs = ts
  12. break
  13. end
  14. end
  15. return jobTs
  16. end