summaryrefslogtreecommitdiffstats
path: root/src/daemon/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/service.c')
-rw-r--r--src/daemon/service.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/daemon/service.c b/src/daemon/service.c
index ead633445..f209cb470 100644
--- a/src/daemon/service.c
+++ b/src/daemon/service.c
@@ -203,7 +203,7 @@ static void svc_rrd_cleanup_obsolete_charts_from_all_hosts() {
if (host == localhost)
continue;
- netdata_mutex_lock(&host->receiver_lock);
+ spinlock_lock(&host->receiver_lock);
time_t now = now_realtime_sec();
@@ -215,7 +215,7 @@ static void svc_rrd_cleanup_obsolete_charts_from_all_hosts() {
host->trigger_chart_obsoletion_check = 0;
}
- netdata_mutex_unlock(&host->receiver_lock);
+ spinlock_unlock(&host->receiver_lock);
}
rrd_rdunlock();
@@ -247,14 +247,12 @@ restart_after_removal:
}
worker_is_busy(WORKER_JOB_FREE_HOST);
-#ifdef ENABLE_ACLK
// in case we have cloud connection we inform cloud
// a child disconnected
- if (netdata_cloud_enabled && force) {
+ if (force) {
aclk_host_state_update(host, 0, 0);
unregister_node(host->machine_guid);
}
-#endif
rrdhost_free___while_having_rrd_wrlock(host, force);
goto restart_after_removal;
}
@@ -299,7 +297,7 @@ void *service_main(void *ptr)
CLEANUP_FUNCTION_REGISTER(service_main_cleanup) cleanup_ptr = ptr;
heartbeat_t hb;
- heartbeat_init(&hb);
+ heartbeat_init(&hb, USEC_PER_SEC);
usec_t step = USEC_PER_SEC * SERVICE_HEARTBEAT;
usec_t real_step = USEC_PER_SEC;
@@ -307,7 +305,7 @@ void *service_main(void *ptr)
while (service_running(SERVICE_MAINTENANCE)) {
worker_is_idle();
- heartbeat_next(&hb, USEC_PER_SEC);
+ heartbeat_next(&hb);
if (real_step < step) {
real_step += USEC_PER_SEC;
continue;