1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-12-23 21:25:43 +00:00

Fix token generation and pastie expiry.

This commit is contained in:
King_DuckZ 2018-10-12 20:58:21 +01:00
parent 28cf0ff9b8
commit e649a7bec1

View file

@ -1,9 +1,11 @@
local function num_to_token (num)
local retval = ""
local running = true
num = num + 1
while (running)
do
num = num - 1
local remainder = num % 26
retval = string.char(97 + remainder) .. retval
num = math.floor(num / 26)
@ -36,6 +38,7 @@ local saved = redis.call("HMSET", token_prefix .. token,
"selfdes", selfdestruct
)
if saved then
redis.call("EXPIRE", token_prefix .. token, ttl)
redis.call("SET", flooding_token, "")
redis.call("EXPIRE", flooding_token, flood_wait)
else