formtoken.lua 238 B

1234567891011
  1. local key = KEYS[1]
  2. local field = ARGV[1]
  3. local afterNum = -1;
  4. local iExists = redis.call("HEXISTS", key, field);
  5. if (iExists == 0) then
  6. else
  7. afterNum = tonumber(redis.call("HINCRBY", key, field, 1))
  8. end
  9. return tostring(afterNum);