From f8db5bc9832e4625d23ce1b7df4e744460e8f96d Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 3 Sep 2021 01:38:07 +1000 Subject: Don't kick off stats collection unless sledjchisl is a web server. --- src/sledjchisl/sledjchisl.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 4651a69..0907ab1 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -8798,16 +8798,19 @@ fi goto finished; } - // Need to kick this off. - stats = getStats(database, stats); - char *h = qstrunchar(qconfig->getstr(qconfig, "Const.HostName", false), '"', '"'); - char *p = qstrunchar(qconfig->getstr(qconfig, "Const.PublicPort", false), '"', '"'); - stats->stats->putstr(stats->stats, "grid", qstrunchar(qconfig->getstr(qconfig, "Const.GridName", false), '"', '"')); - stats->stats->putstr(stats->stats, "HostName", h); - stats->stats->putstr(stats->stats, "PublicPort", p); - snprintf(toybuf, sizeof(toybuf), "http://%s:%s/", h, p); - - stats->stats->putstr(stats->stats, "uri", toybuf); + if (isWeb) + { + // Need to kick this off. + stats = getStats(database, stats); + char *h = qstrunchar(qconfig->getstr(qconfig, "Const.HostName", false), '"', '"'); + char *p = qstrunchar(qconfig->getstr(qconfig, "Const.PublicPort", false), '"', '"'); + stats->stats->putstr(stats->stats, "grid", qstrunchar(qconfig->getstr(qconfig, "Const.GridName", false), '"', '"')); + stats->stats->putstr(stats->stats, "HostName", h); + stats->stats->putstr(stats->stats, "PublicPort", p); + snprintf(toybuf, sizeof(toybuf), "http://%s:%s/", h, p); + + stats->stats->putstr(stats->stats, "uri", toybuf); + } qconfig->free(qconfig); } -- cgit v1.1