From 31ca90501356e5d875681adb6006a41793785f4c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 28 May 2017 19:42:52 +0200 Subject: [PATCH] stats: dont print periodic stats if path is not running --- lib/hooks/stats_collect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/hooks/stats_collect.c b/lib/hooks/stats_collect.c index 9ed5e8194..0c3309093 100644 --- a/lib/hooks/stats_collect.c +++ b/lib/hooks/stats_collect.c @@ -24,6 +24,7 @@ * @{ */ +#include "common.h" #include "hook.h" #include "plugin.h" #include "stats.h" @@ -111,7 +112,8 @@ static int stats_collect_periodic(struct hook *h) { struct stats_collect *p = h->_vd; - stats_print_periodic(&p->stats, p->output, p->format, p->verbose, h->path); + if (h->path->state == STATE_STARTED) + stats_print_periodic(&p->stats, p->output, p->format, p->verbose, h->path); return 0; }