Fix race in multiple DB mirroring configurations.
This commit is contained in:
parent
ad2a7c2590
commit
28d0070ce2
5 changed files with 30 additions and 20 deletions
|
@ -114,6 +114,28 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
inline bool _compareRecords(const nlohmann::json &a,const nlohmann::json &b)
|
||||
{
|
||||
if (a.is_object() == b.is_object()) {
|
||||
if (a.is_object()) {
|
||||
if (a.size() != b.size())
|
||||
return false;
|
||||
auto amap = a.get<nlohmann::json::object_t>();
|
||||
auto bmap = b.get<nlohmann::json::object_t>();
|
||||
for(auto ai=amap.begin();ai!=amap.end();++ai) {
|
||||
if (ai->first != "revision") { // ignore revision, compare only non-revision-counter fields
|
||||
auto bi = bmap.find(ai->first);
|
||||
if ((bi == bmap.end())||(bi->second != ai->second))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return (a == b);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
struct _Network
|
||||
{
|
||||
_Network() : mostRecentDeauthTime(0) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue