From: Alexander Moisseev Date: Fri, 29 May 2026 13:43:56 +0000 (+0300) Subject: [Minor] upstream: improve cooldown log message clarity X-Git-Tag: 4.1.0~10^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=536978f700da902df4acfecf61544c1e8262101a;p=thirdparty%2Frspamd.git [Minor] upstream: improve cooldown log message clarity When elapsed time rounded to the same value as the minimum interval, the log showed "checked 60 seconds ago (60 is minimum)", suggesting the check was skipped at equality despite the strict < comparison. Replace with remaining cooldown time using ceil() to avoid ambiguity. --- diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index 3f470bf8b7..7896d0cba8 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -1452,11 +1452,12 @@ rspamd_upstream_resolve_addrs(const struct upstream_list *ls, double now = ev_now(upstream->ctx->event_loop); - if (now - upstream->last_resolve < upstream->ctx->limits.resolve_min_interval) { - msg_info_upstream("do not resolve upstream %s as it was checked %.0f " - "seconds ago (%.0f is minimum)", - upstream->name, now - upstream->last_resolve, - upstream->ctx->limits.resolve_min_interval); + double remaining = upstream->ctx->limits.resolve_min_interval - + (now - upstream->last_resolve); + if (remaining > 0) { + msg_info_upstream("do not resolve upstream %s: cooldown remains " + "%.0f seconds", + upstream->name, ceil(remaining)); return; }