diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-07-09 16:53:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-07-09 16:53:44 +0100 |
commit | 7f19699410f7d85ee9468b7ab6afab2fd1a4cedd (patch) | |
tree | 4544d6a2c711877f8dc24e3b3b832d49c27c06a1 /src/plugins | |
parent | 87702745e128977d238284b2a69415bcf94974e6 (diff) | |
download | rspamd-7f19699410f7d85ee9468b7ab6afab2fd1a4cedd.tar.gz rspamd-7f19699410f7d85ee9468b7ab6afab2fd1a4cedd.zip |
[Minor] Mention mode of dynamic limits in the log
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index c3602f915..f3331e850 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -527,11 +527,20 @@ local function ratelimit_cb(task) string.format('%s(%s)', lim_name, lim_key)) end end - rspamd_logger.infox(task, - 'ratelimit "%s(%s)" exceeded, (%s / %s): %s (%s:%s dyn); redis key: %s', - lim_name, prefix, - bucket.burst, bucket.rate, - data[2], data[3], data[4], lim_key) + + if bucket.dyn_rate_enabled then + rspamd_logger.infox(task, + 'ratelimit "%s(%s)" exceeded, (%s / %s): %s (%s:%s dyn); redis key: %s', + lim_name, prefix, + bucket.burst, bucket.rate, + data[2], data[3], data[4], lim_key) + else + rspamd_logger.infox(task, + 'ratelimit "%s(%s)" exceeded, (%s / %s): %s (dynamic ratelimits disabled); redis key: %s', + lim_name, prefix, + bucket.burst, bucket.rate, + data[2], lim_key) + end if not (bucket.symbol or settings.symbol) and not bucket.skip_soft_reject then if not bucket.message then |