summaryrefslogtreecommitdiff
path: root/controller/LFDB.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2019-08-08 15:29:13 -0500
committerAdam Ierymenko <adam.ierymenko@gmail.com>2019-08-08 15:29:13 -0500
commit28d0070ce2e791727c388646f22119e350ab6d78 (patch)
tree9cd411fad644e021b5ccb64e47c0ab8ac74358a6 /controller/LFDB.cpp
parentad2a7c2590467270486c15144330f2c3e87ec080 (diff)
downloadinfinitytier-28d0070ce2e791727c388646f22119e350ab6d78.tar.gz
infinitytier-28d0070ce2e791727c388646f22119e350ab6d78.zip
Fix race in multiple DB mirroring configurations.
Diffstat (limited to 'controller/LFDB.cpp')
-rw-r--r--controller/LFDB.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/controller/LFDB.cpp b/controller/LFDB.cpp
index 3b800ec2..35068321 100644
--- a/controller/LFDB.cpp
+++ b/controller/LFDB.cpp
@@ -369,7 +369,7 @@ bool LFDB::save(nlohmann::json &record,bool notifyListeners)
if (nwid) {
nlohmann::json old;
get(nwid,old);
- if ((!old.is_object())||(old != record)) {
+ if ((!old.is_object())||(!_compareRecords(old,record))) {
record["revision"] = OSUtils::jsonInt(record["revision"],0ULL) + 1ULL;
_networkChanged(old,record,notifyListeners);
{
@@ -385,7 +385,7 @@ bool LFDB::save(nlohmann::json &record,bool notifyListeners)
if ((id)&&(nwid)) {
nlohmann::json network,old;
get(nwid,network,id,old);
- if ((!old.is_object())||(old != record)) {
+ if ((!old.is_object())||(!_compareRecords(old,record))) {
record["revision"] = OSUtils::jsonInt(record["revision"],0ULL) + 1ULL;
_memberChanged(old,record,notifyListeners);
{