addDelayMarkerIfNeeded.lua 386 B

123456789101112131415
  1. --[[
  2. Add delay marker if needed.
  3. ]]
  4. -- Includes
  5. --- @include "getNextDelayedTimestamp"
  6. local function addDelayMarkerIfNeeded(markerKey, delayedKey)
  7. local nextTimestamp = getNextDelayedTimestamp(delayedKey)
  8. if nextTimestamp ~= nil then
  9. -- Replace the score of the marker with the newest known
  10. -- next timestamp.
  11. rcall("ZADD", markerKey, nextTimestamp, "1")
  12. end
  13. end