From f1db235a36d85f81c5a19a7087567405771874f7 Mon Sep 17 00:00:00 2001 From: Timotej S <6674623+underhood@users.noreply.github.com> Date: Thu, 26 Nov 2020 17:26:01 +0100 Subject: ACLK Child Availability Messages (#9918) * new ACLK messages for Claiming MVP1 --- claim/claim.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'claim') diff --git a/claim/claim.c b/claim/claim.c index 7846925e6d..d87f46a7f8 100644 --- a/claim/claim.c +++ b/claim/claim.c @@ -34,9 +34,9 @@ static char *claiming_errors[] = { char *is_agent_claimed() { char *result; - netdata_mutex_lock(&localhost->claimed_id_lock); - result = (localhost->claimed_id == NULL) ? NULL : strdupz(localhost->claimed_id); - netdata_mutex_unlock(&localhost->claimed_id_lock); + rrdhost_aclk_state_lock(localhost); + result = (localhost->aclk_state.claimed_id == NULL) ? NULL : strdupz(localhost->aclk_state.claimed_id); + rrdhost_aclk_state_unlock(localhost); return result; } @@ -134,10 +134,10 @@ void load_claiming_state(void) netdata_cloud_setting = 0; #else uuid_t uuid; - netdata_mutex_lock(&localhost->claimed_id_lock); - if (localhost->claimed_id) { - freez(localhost->claimed_id); - localhost->claimed_id = NULL; + rrdhost_aclk_state_lock(localhost); + if (localhost->aclk_state.claimed_id) { + freez(localhost->aclk_state.claimed_id); + localhost->aclk_state.claimed_id = NULL; } if (aclk_connected) { @@ -159,8 +159,8 @@ void load_claiming_state(void) freez(claimed_id); claimed_id = NULL; } - localhost->claimed_id = claimed_id; - netdata_mutex_unlock(&localhost->claimed_id_lock); + localhost->aclk_state.claimed_id = claimed_id; + rrdhost_aclk_state_unlock(localhost); if (!claimed_id) { info("Unable to load '%s', setting state to AGENT_UNCLAIMED", filename); return; -- cgit v1.2.3