]> arthur.barton.de Git - netdata.git/commitdiff
properly reset green and red thresholds after health configuration reload
authorCosta Tsaousis <costa@tsaousis.gr>
Sat, 20 Aug 2016 21:35:00 +0000 (00:35 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Sat, 20 Aug 2016 21:35:00 +0000 (00:35 +0300)
src/health.c

index e379943ad152b3d67b7314d456f64ae0bc1bc107..bf37b013f62b1f662b93deaa8bf7dc7eab077956 100644 (file)
@@ -1385,17 +1385,19 @@ void health_reload(void) {
     health_free_all_nolock(&localhost);
     rrdhost_unlock(&localhost);
 
+    RRDSET *st;
+    for(st = localhost.rrdset_root; st ; st = st->next) {
+        st->green = NAN;
+        st->red = NAN;
+    }
+
     rrdhost_rwlock(&localhost);
     health_readdir(path);
     rrdhost_unlock(&localhost);
 
-    RRDSET *st;
     for(st = localhost.rrdset_root; st ; st = st->next) {
         rrdhost_rwlock(&localhost);
 
-        st->green = NAN;
-        st->red = NAN;
-
         rrdsetcalc_link_matching(st);
         rrdcalctemplate_link_matching(st);