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
|
@ -125,14 +125,14 @@ bool DBMirrorSet::save(nlohmann::json &record,bool notifyListeners)
|
|||
}
|
||||
if (notifyListeners) {
|
||||
for(auto d=dbs.begin();d!=dbs.end();++d) {
|
||||
if ((*d)->save(record,notifyListeners))
|
||||
if ((*d)->save(record,true))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
bool modified = false;
|
||||
for(auto d=dbs.begin();d!=dbs.end();++d) {
|
||||
modified |= (*d)->save(record,notifyListeners);
|
||||
modified |= (*d)->save(record,false);
|
||||
}
|
||||
return modified;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue