commit 130a6f1: [Minor] Relax heartbeat checks

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Sep 16 15:07:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-09-16 16:02:37 +0100
URL: https://github.com/rspamd/rspamd/commit/130a6f1c1906e7ec8455fd3304d9f727841b7e36

[Minor] Relax heartbeat checks

---
 src/libserver/worker_util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 19c5ac030..f6fef8df5 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -722,7 +722,9 @@ rspamd_main_heartbeat_cb (EV_P_ ev_timer *w, int revents)
 	time_from_last -= wrk->hb.last_event;
 	rspamd_main = wrk->srv;
 
-	if (time_from_last > 0 && time_from_last > rspamd_main->cfg->heartbeat_interval) {
+	if (time_from_last > 0 &&
+		time_from_last >= rspamd_main->cfg->heartbeat_interval * 2) {
+
 		rspamd_localtime (wrk->hb.last_event, &tm);
 		r = strftime (timebuf, sizeof (timebuf), "%F %H:%M:%S", &tm);
 		rspamd_snprintf (usec_buf, sizeof (usec_buf), "%.5f",


More information about the Commits mailing list