From: Pavel Rochnyack Date: Wed, 4 Jul 2018 06:15:48 +0000 (+0700) Subject: core: Cleanup in vl->interval assignment X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a58ed75245f03924612a98745cba74f3464b4d77;p=collectd.git core: Cleanup in vl->interval assignment --- diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c index b91672fc..b2bc0b1c 100644 --- a/src/daemon/plugin.c +++ b/src/daemon/plugin.c @@ -713,25 +713,8 @@ plugin_value_list_clone(value_list_t const *vl_orig) /* {{{ */ vl->time = cdtime(); /* Fill in the interval from the thread context, if it is zero. */ - if (vl->interval == 0) { - plugin_ctx_t ctx = plugin_get_ctx(); - - if (ctx.interval != 0) - vl->interval = ctx.interval; - else { - char name[6 * DATA_MAX_NAME_LEN]; - FORMAT_VL(name, sizeof(name), vl); - ERROR("plugin_value_list_clone: Unable to determine " - "interval from context for " - "value list \"%s\". " - "This indicates a broken plugin. " - "Please report this problem to the " - "collectd mailing list or at " - ".", - name); - vl->interval = cf_get_default_interval(); - } - } + if (vl->interval == 0) + vl->interval = plugin_get_interval(); return vl; } /* }}} value_list_t *plugin_value_list_clone */ @@ -2531,6 +2514,8 @@ cdtime_t plugin_get_interval(void) { if (interval > 0) return interval; + ERROR("plugin_get_interval: Unable to determine interval from context."); + return cf_get_default_interval(); } /* cdtime_t plugin_get_interval */