From f8b6298d2bba39714a84920b420a3b95b239b2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Mon, 30 Oct 2023 11:12:49 +0100 Subject: [PATCH] no need for elseif --- store/RedisStore.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/store/RedisStore.js b/store/RedisStore.js index 3abe112b..ed4c3853 100644 --- a/store/RedisStore.js +++ b/store/RedisStore.js @@ -20,8 +20,10 @@ const lua = ` if ttl == -1 then redis.call('PEXPIRE', key, timeWindow) return {1, timeWindow} - -- If the key's incremented value has exceeded the max value, then reset its TTL - elseif continueExceeding and value > max then + end + + -- If the key's incremented value has exceeded the max value then reset its TTL + if continueExceeding and value > max then redis.call('PEXPIRE', key, timeWindow) return {value, timeWindow} end