diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-10 14:39:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-10 14:39:07 +0100 |
commit | 0fa1c80b1d4f962ccf8d24f040c700346ed874f0 (patch) | |
tree | 7e1b27c3e238ec7404ed02cb0317dcd41def2c5c | |
parent | fb2d63d037216bc006538cf93e3643cb82abc51f (diff) | |
download | rspamd-0fa1c80b1d4f962ccf8d24f040c700346ed874f0.tar.gz rspamd-0fa1c80b1d4f962ccf8d24f040c700346ed874f0.zip |
[Minor] Fix rate check code
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 935a4a247..446906dd2 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -403,9 +403,9 @@ local function ratelimit_cb(task) rspamd_logger.debugm(N, task, "check limit %s:%s -> %s (%s/%s)", value.name, pr, value.hash, bucket[2], bucket[1]) lua_redis.exec_redis_script(bucket_check_id, - {task = task, is_write = true}, + {key = value.hash, task = task, is_write = true}, gen_check_cb(pr, bucket, value.name), - {pr.hash, tostring(now), tostring(rate), tostring(bucket[2]), + {value.hash, tostring(now), tostring(rate), tostring(bucket[2]), tostring(settings.expire)}) end end @@ -451,7 +451,7 @@ local function ratelimit_update_cb(task) now = lua_util.round(now * 1000.0) -- Get milliseconds lua_redis.exec_redis_script(bucket_update_id, - {task = task, is_write = true}, + {key = v.hash, task = task, is_write = true}, update_bucket_cb, {v.hash, tostring(now), tostring(mult_rate), tostring(mult_burst), tostring(settings.max_rate_mult), tostring(settings.max_bucket_mult), |