mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
@@ -125,7 +125,7 @@ int adapter_load_setting(const char *node, char **setting)
|
||||
{
|
||||
int rv = neu_persister_load_node_setting(node, (const char **) setting);
|
||||
if (0 != rv) {
|
||||
nlog_error("load %s setting fail", node);
|
||||
nlog_warn("load %s setting fail", node);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+14
-5
@@ -599,11 +599,20 @@ void neu_persister_destroy()
|
||||
|
||||
int neu_persister_store_node(neu_persist_node_info_t *info)
|
||||
{
|
||||
int rv =
|
||||
execute_sql(global_db,
|
||||
"INSERT INTO nodes (name, type, state, plugin_name) "
|
||||
"VALUES (%Q, %i, %i, %Q)",
|
||||
info->name, info->type, info->state, info->plugin_name);
|
||||
int rv = 0;
|
||||
if (strcmp(info->plugin_name, "Monitor") == 0) {
|
||||
rv = execute_sql(
|
||||
global_db,
|
||||
"INSERT OR IGNORE INTO nodes (name, type, state, plugin_name) "
|
||||
"VALUES (%Q, %i, %i, %Q)",
|
||||
info->name, info->type, info->state, info->plugin_name);
|
||||
} else {
|
||||
rv =
|
||||
execute_sql(global_db,
|
||||
"INSERT INTO nodes (name, type, state, plugin_name) "
|
||||
"VALUES (%Q, %i, %i, %Q)",
|
||||
info->name, info->type, info->state, info->plugin_name);
|
||||
}
|
||||
if (0 == rv) {
|
||||
node_count_add(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user