commit c2c75d2: [Minor] Use configured monitored interval

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Mar 2 17:07:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-02 17:04:40 +0000
URL: https://github.com/rspamd/rspamd/commit/c2c75d2c816b4e96852d92085346ee2a6c5f2bab (HEAD -> master)

[Minor] Use configured monitored interval
Issue: #2776
Closes: #2776

---
 src/libserver/monitored.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/libserver/monitored.c b/src/libserver/monitored.c
index 9adcab943..39590bfcc 100644
--- a/src/libserver/monitored.c
+++ b/src/libserver/monitored.c
@@ -51,7 +51,6 @@ struct rspamd_monitored_ctx {
 
 struct rspamd_monitored {
 	gchar *url;
-	gdouble monitoring_interval;
 	gdouble monitoring_mult;
 	gdouble offline_time;
 	gdouble total_offline_time;
@@ -173,7 +172,7 @@ rspamd_monitored_periodic (gint fd, short what, gpointer ud)
 	gdouble jittered;
 	gboolean ret = FALSE;
 
-	jittered = rspamd_time_jitter (m->monitoring_interval * m->monitoring_mult,
+	jittered = rspamd_time_jitter (m->ctx->monitoring_interval * m->monitoring_mult,
 			0.0);
 	double_to_tv (jittered, &tv);
 
@@ -480,7 +479,6 @@ rspamd_monitored_create_ (struct rspamd_monitored_ctx *ctx,
 	m->flags = flags;
 	m->url = g_strdup (line);
 	m->ctx = ctx;
-	m->monitoring_interval = ctx->monitoring_interval;
 	m->monitoring_mult = 1.0;
 	m->max_errors = ctx->max_errors;
 	m->alive = TRUE;
@@ -602,7 +600,7 @@ rspamd_monitored_start (struct rspamd_monitored *m)
 
 	g_assert (m != NULL);
 	msg_debug_mon ("started monitored object %s", m->url);
-	jittered = rspamd_time_jitter (m->monitoring_interval * m->monitoring_mult,
+	jittered = rspamd_time_jitter (m->ctx->monitoring_interval * m->monitoring_mult,
 			0.0);
 	double_to_tv (jittered, &tv);
 


More information about the Commits mailing list