getOrSetMaxEvents.lua 308 B

1234567891011
  1. --[[
  2. Function to get max events value or set by default 10000.
  3. ]]
  4. local function getOrSetMaxEvents(metaKey)
  5. local maxEvents = rcall("HGET", metaKey, "opts.maxLenEvents")
  6. if not maxEvents then
  7. maxEvents = 10000
  8. rcall("HSET", metaKey, "opts.maxLenEvents", maxEvents)
  9. end
  10. return maxEvents
  11. end