ag_gen/redis_scripts/collisions.lua
2021-09-23 13:55:29 -05:00

12 lines
237 B
Lua
Executable File

local hash = KEYS[1]
local id = ARGV[1]
redis.call("sadd", "collisions", hash)
local count = redis.call("incr", "count:"..hash)
local new_string = hash.."_"..count
redis.call("hset", "idmap:"..new_string, "id", id)
return new_string