]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Minor fixes for previous ratelimit changes 4549/head
authorAndrew Lewis <nerf@judo.za.org>
Mon, 24 Jul 2023 17:00:36 +0000 (19:00 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 24 Jul 2023 17:00:36 +0000 (19:00 +0200)
lualib/redis_scripts/ratelimit_cleanup_pending.lua
src/plugins/lua/ratelimit.lua

index f51599b09774988914f9b935aff14288fa6ceee1..67ae634f1a9df3827ec7fba7ef83c6b0e36b06b5 100644 (file)
@@ -22,7 +22,7 @@ pending = tonumber(pending or '0')
 if pending < nrcpt then pending = 0 else pending = pending - nrcpt end
 
 -- 3. Set the updated values back to Redis and update the expiration time for the bucket
-redis.call('HMSET', prefix, tostring(pending), 'l', KEYS[2])
+redis.call('HMSET', prefix, 'p', tostring(pending), 'l', KEYS[2])
 redis.call('EXPIRE', prefix, KEYS[3])
 
 -- 4. Return the updated pending value
index e2e4e6887f041ba46317c4083bc6f9cfda210533..b225d0650bc6ad886cf629bb2949300f96cfd8eb 100644 (file)
@@ -544,7 +544,7 @@ local function maybe_cleanup_pending(task)
   if task:cache_get('ratelimit_bucket_touched') then
     local prefixes = task:cache_get('ratelimit_prefixes')
     if prefixes then
-      for k, v in pairs(prefixes) or E do
+      for k, v in pairs(prefixes) do
         local bucket = v.bucket
         local function cleanup_cb(err, data)
           if err then