getNextDelayedTimestamp.lua 328 B

123456789101112
  1. --[[
  2. Function to return the next delayed job timestamp.
  3. ]]
  4. local function getNextDelayedTimestamp(delayedKey)
  5. local result = rcall("ZRANGE", delayedKey, 0, 0, "WITHSCORES")
  6. if #result then
  7. local nextTimestamp = tonumber(result[2])
  8. if nextTimestamp ~= nil then
  9. return nextTimestamp / 0x1000
  10. end
  11. end
  12. end