(Probably almost) implement cluster client

This commit is contained in:
Vitaliy Filippov
2020-06-07 00:09:36 +03:00
parent 2f6cf605a1
commit c573bc6bb3
13 changed files with 432 additions and 86 deletions
+5 -2
View File
@@ -93,7 +93,10 @@ void etcd_state_client_t::start_etcd_watcher()
parse_state(kv.first, kv.second);
}
// React to changes
on_change_hook(changes);
if (on_change_hook != NULL)
{
on_change_hook(changes);
}
}
}
if (msg->eof)
@@ -208,7 +211,7 @@ void etcd_state_client_t::load_pgs()
},
};
json11::Json::object req = { { "success", txn } };
json11::Json checks = load_pgs_checks_hook();
json11::Json checks = load_pgs_checks_hook != NULL ? load_pgs_checks_hook() : json11::Json();
if (checks.array_items().size() > 0)
{
req["compare"] = checks;