more consistent variables

master
Bel LaPointe 2021-02-26 23:08:05 -06:00
parent da08be0285
commit efed1ce04f
1 changed files with 8 additions and 9 deletions

View File

@ -1304,11 +1304,10 @@
sync()
{
console.log("syncing to replicas: " + this.pendingSyncCount());
this.deltas.popEach((k) => {
console.log("syncing to replicas: " + k);
this.replicate(k);
this.deltas.popEach((key) => {
console.log("syncing to replicas: " + key);
this.replicate(key);
});
console.log("synced to replicas: " + this.pendingSyncCount());
this.writePendingSyncCount();
}
@ -1326,14 +1325,14 @@
document.getElementById("pending").innerHTML = s;
}
replicate(k)
replicate(key)
{
var v = this.primary().get(k);
var value = this.primary().get(key);
this.replicas().forEach((database) => {
if (v)
database.set(k, v);
if (value)
database.set(key, value);
else
database.del(k, v);
database.del(key, value);
});
}