From ac4239cef06a60d63c5396044b2c7e35bcbda923 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 8 Jun 2024 13:36:11 +0100 Subject: [Feature] Make min_resolve_interval configurable --- src/libserver/cfg_file.h | 1 + src/libserver/cfg_rcl.cxx | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'src/libserver') 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"))) { -- cgit v1.2.3