more consistent variables
parent
da08be0285
commit
efed1ce04f
|
|
@ -1304,11 +1304,10 @@
|
||||||
sync()
|
sync()
|
||||||
{
|
{
|
||||||
console.log("syncing to replicas: " + this.pendingSyncCount());
|
console.log("syncing to replicas: " + this.pendingSyncCount());
|
||||||
this.deltas.popEach((k) => {
|
this.deltas.popEach((key) => {
|
||||||
console.log("syncing to replicas: " + k);
|
console.log("syncing to replicas: " + key);
|
||||||
this.replicate(k);
|
this.replicate(key);
|
||||||
});
|
});
|
||||||
console.log("synced to replicas: " + this.pendingSyncCount());
|
|
||||||
this.writePendingSyncCount();
|
this.writePendingSyncCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1326,14 +1325,14 @@
|
||||||
document.getElementById("pending").innerHTML = s;
|
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) => {
|
this.replicas().forEach((database) => {
|
||||||
if (v)
|
if (value)
|
||||||
database.set(k, v);
|
database.set(key, value);
|
||||||
else
|
else
|
||||||
database.del(k, v);
|
database.del(key, value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue