destructureJobKey.lua 332 B

123456789101112
  1. --[[
  2. Functions to destructure job key.
  3. Just a bit of warning, these functions may be a bit slow and affect performance significantly.
  4. ]]
  5. local getJobIdFromKey = function (jobKey)
  6. return string.match(jobKey, ".*:(.*)")
  7. end
  8. local getJobKeyPrefix = function (jobKey, jobId)
  9. return string.sub(jobKey, 0, #jobKey - #jobId)
  10. end