Skip to content

Commit a6282f2

Browse files
authored
Merge pull request #198 from leonardodeoliveira/patch-1
Add TTL for sliding window stats_key
2 parents 91fe5d4 + 387bf63 commit a6282f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/RedisRateLimiting/SlidingWindow/RedisSlidingWindowManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ internal class RedisSlidingWindowManager
3838
redis.call(""hincrby"", @stats_key, 'total_failed', 1)
3939
end
4040
41+
redis.call(""pexpireat"", @stats_key, expireAtMilliseconds)
42+
4143
return { allowed, count }");
4244

4345
private static readonly LuaScript StatisticsScript = LuaScript.Prepare(

0 commit comments

Comments
 (0)