1.编写lua脚本用于生成主键ID序列号,内容如下 local key = tostring(KEYS[1]); local count = tonumber(KEYS[2]); local dateStr = tostring(KEYS[3]); local newKey = key .. "_" .. dateStr; local numRedis = redis.call("incr", newKey); print(numRedis); if (numRed…
什么是环境? http://www.lua.org/manual/5.1/manual.html#2.9 Besides metatables, objects of types thread, function, and userdata have another table associated with them, called their environment. Like metatables, environments are regular tables and multiple…