mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 04:57:53 +00:00
debug strings & query fixes
This commit is contained in:
parent
fd174b3459
commit
9380ef708a
@ -248,17 +248,25 @@ bool PostgreSQL::save(nlohmann::json &record,bool notifyListeners)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (objtype == "member") {
|
} else if (objtype == "member") {
|
||||||
|
std::string networkId = record["nwid"];
|
||||||
|
std::string memberId = record["id"];
|
||||||
const uint64_t nwid = OSUtils::jsonIntHex(record["nwid"],0ULL);
|
const uint64_t nwid = OSUtils::jsonIntHex(record["nwid"],0ULL);
|
||||||
const uint64_t id = OSUtils::jsonIntHex(record["id"],0ULL);
|
const uint64_t id = OSUtils::jsonIntHex(record["id"],0ULL);
|
||||||
|
fprintf(stderr, "member save %s-%s\n", networkId.c_str(), memberId.c_str());
|
||||||
if ((id)&&(nwid)) {
|
if ((id)&&(nwid)) {
|
||||||
nlohmann::json network,old;
|
nlohmann::json network,old;
|
||||||
get(nwid,network,id,old);
|
get(nwid,network,id,old);
|
||||||
if ((!old.is_object())||(!_compareRecords(old,record))) {
|
if ((!old.is_object())||(!_compareRecords(old,record))) {
|
||||||
|
fprintf(stderr, "commit queue post\n");
|
||||||
record["revision"] = OSUtils::jsonInt(record["revision"],0ULL) + 1ULL;
|
record["revision"] = OSUtils::jsonInt(record["revision"],0ULL) + 1ULL;
|
||||||
_commitQueue.post(std::pair<nlohmann::json,bool>(record,notifyListeners));
|
_commitQueue.post(std::pair<nlohmann::json,bool>(record,notifyListeners));
|
||||||
modified = true;
|
modified = true;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "no change\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "uhh waaat\n");
|
||||||
}
|
}
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
fprintf(stderr, "Error on PostgreSQL::save: %s\n", e.what());
|
fprintf(stderr, "Error on PostgreSQL::save: %s\n", e.what());
|
||||||
|
Loading…
Reference in New Issue
Block a user