summaryrefslogtreecommitdiffstats
path: root/database/sqlite/sqlite_aclk.c
diff options
context:
space:
mode:
Diffstat (limited to 'database/sqlite/sqlite_aclk.c')
-rw-r--r--database/sqlite/sqlite_aclk.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/database/sqlite/sqlite_aclk.c b/database/sqlite/sqlite_aclk.c
index 6803092f2..63196a81e 100644
--- a/database/sqlite/sqlite_aclk.c
+++ b/database/sqlite/sqlite_aclk.c
@@ -189,6 +189,24 @@ int aclk_worker_enq_cmd(char *node_id, struct aclk_database_cmd *cmd)
return (wc == NULL);
}
+struct aclk_database_worker_config *find_inactive_wc_by_node_id(char *node_id)
+{
+ if (unlikely(!node_id))
+ return NULL;
+
+ uv_mutex_lock(&aclk_async_lock);
+ struct aclk_database_worker_config *wc = aclk_thread_head;
+
+ while (wc) {
+ if (!strcmp(wc->node_id, node_id))
+ break;
+ wc = wc->next;
+ }
+ uv_mutex_unlock(&aclk_async_lock);
+
+ return (wc);
+}
+
void aclk_sync_exit_all()
{
rrd_wrlock();