]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use configured monitored interval
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 2 Mar 2019 17:04:40 +0000 (17:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 2 Mar 2019 17:04:40 +0000 (17:04 +0000)
Issue: #2776
Closes: #2776
src/libserver/monitored.c

index 9adcab943ad69c0e93a2cf6974b64cbef2e4d082..39590bfcc8fbc5f56a915112998a4c477224ecd9 100644 (file)
@@ -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);