summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2020-03-30 15:38:07 +0300
committerGitHub <noreply@github.com>2020-03-30 15:38:07 +0300
commit71e1ef8c38181ea5bb491b020f30eeb11c10069f (patch)
tree1494ccd1493e3a6156d390842add59fd78731712 /collectors
parentc59ad7814e5fcc00d5a802a3dae5b4b9d27b7041 (diff)
charts.d.plugin: add keepalive to global_update (#8529)
Diffstat (limited to 'collectors')
-rwxr-xr-xcollectors/charts.d.plugin/charts.d.plugin.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/collectors/charts.d.plugin/charts.d.plugin.in b/collectors/charts.d.plugin/charts.d.plugin.in
index fc67a9af93..e28926b636 100755
--- a/collectors/charts.d.plugin/charts.d.plugin.in
+++ b/collectors/charts.d.plugin/charts.d.plugin.in
@@ -612,6 +612,12 @@ debug "run_charts='$run_charts'"
[ -z "$run_charts" ] && fatal "No charts to collect data from."
+keepalive() {
+ if [ ! -t 1 ] && ! printf "\n"; then
+ chartsd_cleanup
+ fi
+}
+
declare -A charts_last_update=() charts_update_every=() charts_retries=() charts_next_update=() charts_run_counter=() charts_serial_failures=()
global_update() {
local exit_at \
@@ -642,6 +648,8 @@ global_update() {
# the main loop
while [ "${#next_charts[@]}" -gt 0 ]; do
+ keepalive
+
c=$((c + 1))
now_charts=("${next_charts[@]}")
next_charts=()