Skip to content

Commit c34fb8c

Browse files
fix: don't reset expiration when TTL is zero
1 parent d043845 commit c34fb8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/scripts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const scripts = {
99
increment: `
1010
local totalHits = redis.call("INCR", KEYS[1])
1111
local timeToExpire = redis.call("PTTL", KEYS[1])
12-
if timeToExpire <= 0 or ARGV[1] == "1"
12+
if timeToExpire < 0 or ARGV[1] == "1"
1313
then
1414
redis.call("PEXPIRE", KEYS[1], tonumber(ARGV[2]))
1515
timeToExpire = tonumber(ARGV[2])

0 commit comments

Comments
 (0)