summaryrefslogtreecommitdiffstats
path: root/daemon/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/service.c')
-rw-r--r--daemon/service.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/daemon/service.c b/daemon/service.c
index a25e2a26b..f7fe86e04 100644
--- a/daemon/service.c
+++ b/daemon/service.c
@@ -105,14 +105,11 @@ static bool svc_rrdset_archive_obsolete_dimensions(RRDSET *st, bool all_dimensio
return done_all_dimensions;
}
-static void svc_rrdset_obsolete_to_archive(RRDSET *st) {
- worker_is_busy(WORKER_JOB_ARCHIVE_CHART);
-
+static void svc_rrdset_obsolete_to_free(RRDSET *st) {
if(!svc_rrdset_archive_obsolete_dimensions(st, true))
return;
- rrdset_flag_set(st, RRDSET_FLAG_ARCHIVED);
- rrdset_flag_clear(st, RRDSET_FLAG_OBSOLETE);
+ worker_is_busy(WORKER_JOB_FREE_CHART);
rrdcalc_unlink_all_rrdset_alerts(st);
@@ -130,10 +127,9 @@ static void svc_rrdset_obsolete_to_archive(RRDSET *st) {
worker_is_busy(WORKER_JOB_SAVE_CHART);
rrdset_save(st);
}
-
- worker_is_busy(WORKER_JOB_FREE_CHART);
- rrdset_free(st);
}
+
+ rrdset_free(st);
}
static void svc_rrdhost_cleanup_obsolete_charts(RRDHOST *host) {
@@ -150,12 +146,15 @@ static void svc_rrdhost_cleanup_obsolete_charts(RRDHOST *host) {
&& st->last_updated.tv_sec + rrdset_free_obsolete_time_s < now
&& st->last_collected_time.tv_sec + rrdset_free_obsolete_time_s < now
)) {
- svc_rrdset_obsolete_to_archive(st);
+ svc_rrdset_obsolete_to_free(st);
}
else if(rrdset_flag_check(st, RRDSET_FLAG_OBSOLETE_DIMENSIONS)) {
rrdset_flag_clear(st, RRDSET_FLAG_OBSOLETE_DIMENSIONS);
svc_rrdset_archive_obsolete_dimensions(st, false);
}
+ else if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_OBSOLETE))) {
+ rrdhost_flag_set(host, RRDHOST_FLAG_PENDING_OBSOLETE_CHARTS);
+ }
}
rrdset_foreach_done(st);
}