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:
parent
28cf0ff9b8
commit
e649a7bec1
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue