diff options
author | Timotej S <6674623+underhood@users.noreply.github.com> | 2022-03-18 10:34:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-18 10:34:31 +0100 |
commit | e2e991eb5bbb71f3028e181b720ee2a193d1e51b (patch) | |
tree | c5d04c835f04b60a95cad7fcae5024dd2b006c84 /aclk | |
parent | b5d221ec76c351e24843a21952707e2defc9d12c (diff) |
Add delay on missing priv_key (#12450)
Diffstat (limited to 'aclk')
-rw-r--r-- | aclk/aclk.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/aclk/aclk.c b/aclk/aclk.c index ac6db78ac1..4be12b1b0e 100644 --- a/aclk/aclk.c +++ b/aclk/aclk.c @@ -123,7 +123,7 @@ static int wait_till_agent_claimed(void) * @param aclk_hostname points to location where string pointer to hostname will be set * @param aclk_port port to int where port will be saved * - * @return If non 0 returned irrecoverable error happened and ACLK should be terminated + * @return If non 0 returned irrecoverable error happened (or netdata_exit) and ACLK should be terminated */ static int wait_till_agent_claim_ready() { @@ -144,20 +144,20 @@ static int wait_till_agent_claim_ready() // TODO make it without malloc/free memset(&url, 0, sizeof(url_t)); if (url_parse(cloud_base_url, &url)) { - error("Agent is claimed but the configuration is invalid, please fix"); + error("Agent is claimed but the URL in configuration key \"cloud base url\" is invalid, please fix"); url_t_destroy(&url); sleep(5); continue; } url_t_destroy(&url); - if (!load_private_key()) { - sleep(5); - break; - } + if (!load_private_key()) + return 0; + + sleep(5); } - return 0; + return 1; } void aclk_mqtt_wss_log_cb(mqtt_wss_log_type_t log_type, const char* str) |