diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-07-11 12:30:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 12:30:54 +0300 |
commit | 7a67355e15ea1235fc46eb67f78d3a338ee66403 (patch) | |
tree | 60b24f6d61b3f139165657528580b1c4ffc27fa6 /database | |
parent | f44e0c3c1560d0a93f9ed87679e3506aa1013428 (diff) |
Send node info message sooner (#13348)
send node info sooner
Diffstat (limited to 'database')
-rw-r--r-- | database/sqlite/sqlite_aclk.c | 4 | ||||
-rw-r--r-- | database/sqlite/sqlite_aclk_node.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/database/sqlite/sqlite_aclk.c b/database/sqlite/sqlite_aclk.c index 511741a79a..4f415e9dbc 100644 --- a/database/sqlite/sqlite_aclk.c +++ b/database/sqlite/sqlite_aclk.c @@ -473,7 +473,7 @@ void aclk_database_worker(void *arg) fatal_assert(0 == uv_timer_start(&timer_req, timer_cb, TIMER_PERIOD_MS, TIMER_PERIOD_MS)); // wc->retry_count = 0; - wc->node_info_send = (wc->host && !localhost); + wc->node_info_send = 1; // aclk_add_worker_thread(wc); info("Starting ACLK sync thread for host %s -- scratch area %lu bytes", wc->host_guid, sizeof(*wc)); @@ -634,7 +634,7 @@ void aclk_database_worker(void *arg) } } } - if (wc->node_info_send && wc->host && localhost && claimed() && aclk_connected) { + if (wc->node_info_send && localhost && claimed() && aclk_connected) { cmd.opcode = ACLK_DATABASE_NODE_INFO; cmd.completion = NULL; wc->node_info_send = aclk_database_enq_cmd_noblock(wc, &cmd); diff --git a/database/sqlite/sqlite_aclk_node.c b/database/sqlite/sqlite_aclk_node.c index 8e3ba5730c..1650c9e947 100644 --- a/database/sqlite/sqlite_aclk_node.c +++ b/database/sqlite/sqlite_aclk_node.c @@ -61,8 +61,10 @@ void sql_build_node_info(struct aclk_database_worker_config *wc, struct aclk_dat #ifdef ENABLE_ACLK struct update_node_info node_info; - if (!wc->host) + if (!wc->host) { + wc->node_info_send = 1; return; + } rrd_rdlock(); node_info.node_id = wc->node_id; |