aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-06-08 13:36:11 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-06-08 13:36:11 +0100
commitac4239cef06a60d63c5396044b2c7e35bcbda923 (patch)
tree2f4cde74789cbe9a500bafdc89425c4a8b896cb1 /src/libserver
parentd9c1782a8c2b8cbd395d40534e7f398d71938412 (diff)
downloadrspamd-ac4239cef06a60d63c5396044b2c7e35bcbda923.tar.gz
rspamd-ac4239cef06a60d63c5396044b2c7e35bcbda923.zip
[Feature] Make min_resolve_interval configurable
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/cfg_file.h1
-rw-r--r--src/libserver/cfg_rcl.cxx6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index a1ede5669..1ba1d84ad 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -450,6 +450,7 @@ struct rspamd_config {
double upstream_error_time; /**< rate of upstream errors */
double upstream_revive_time; /**< revive timeout for upstreams */
double upstream_lazy_resolve_time; /**< lazy resolve time for upstreams */
+ double upstream_resolve_min_interval; /**< minimum interval for resolving attempts (60 seconds by default) */
struct upstream_ctx *ups_ctx; /**< upstream context */
struct rspamd_dns_resolver *dns_resolver; /**< dns resolver if loaded */
diff --git a/src/libserver/cfg_rcl.cxx b/src/libserver/cfg_rcl.cxx
index 4feb55de0..eb89e6301 100644
--- a/src/libserver/cfg_rcl.cxx
+++ b/src/libserver/cfg_rcl.cxx
@@ -2285,6 +2285,12 @@ rspamd_rcl_config_init(struct rspamd_config *cfg, GHashTable *skip_sections)
G_STRUCT_OFFSET(struct rspamd_config, upstream_lazy_resolve_time),
RSPAMD_CL_FLAG_TIME_FLOAT,
"Time to resolve upstreams addresses in lazy mode");
+ rspamd_rcl_add_default_handler(ssub,
+ "resolve_min_interval",
+ rspamd_rcl_parse_struct_time,
+ G_STRUCT_OFFSET(struct rspamd_config, upstream_resolve_min_interval),
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ "Minumum interval to perform resolving (60 seconds by default)");
}
if (!(skip_sections && g_hash_table_lookup(skip_sections, "actions"))) {