Create dummy bomber database, no alert on background sync fail
parent
efed1ce04f
commit
326d6a60a4
|
|
@ -1303,13 +1303,23 @@
|
||||||
|
|
||||||
sync()
|
sync()
|
||||||
{
|
{
|
||||||
console.log("syncing to replicas: " + this.pendingSyncCount());
|
var n = this.pendingSyncCount();
|
||||||
|
try
|
||||||
|
{
|
||||||
this.deltas.popEach((key) => {
|
this.deltas.popEach((key) => {
|
||||||
console.log("syncing to replicas: " + key);
|
console.log("syncing to replicas: " + key);
|
||||||
this.replicate(key);
|
this.replicate(key);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
console.log("failed to sync: " + e);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
this.writePendingSyncCount();
|
this.writePendingSyncCount();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pendingSyncCount()
|
pendingSyncCount()
|
||||||
{
|
{
|
||||||
|
|
@ -1319,7 +1329,7 @@
|
||||||
writePendingSyncCount()
|
writePendingSyncCount()
|
||||||
{
|
{
|
||||||
var n = this.pendingSyncCount();
|
var n = this.pendingSyncCount();
|
||||||
var s = "(" + n + ")";
|
var s = "(" + n + " items pending replication)";
|
||||||
if (! n)
|
if (! n)
|
||||||
s = ""
|
s = ""
|
||||||
document.getElementById("pending").innerHTML = s;
|
document.getElementById("pending").innerHTML = s;
|
||||||
|
|
@ -1429,6 +1439,27 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Bomber extends Database {
|
||||||
|
get(key) {
|
||||||
|
throw "teehee";
|
||||||
|
}
|
||||||
|
|
||||||
|
set(key, value)
|
||||||
|
{
|
||||||
|
throw "teehee";
|
||||||
|
}
|
||||||
|
|
||||||
|
del(key)
|
||||||
|
{
|
||||||
|
throw "teehee";
|
||||||
|
}
|
||||||
|
|
||||||
|
forEach(foo)
|
||||||
|
{
|
||||||
|
throw "teehee";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Local extends Database {
|
class Local extends Database {
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
|
|
@ -1467,10 +1498,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
globalStorage = new NamespacedDatabase("4", new Local());
|
|
||||||
globalStorage = new MultiDatabase(
|
globalStorage = new MultiDatabase(
|
||||||
new NamespacedDatabase("A", new Local()),
|
new NamespacedDatabase("A", new Local()),
|
||||||
new NamespacedDatabase("B", new Local()),
|
new NamespacedDatabase("B", new Local()),
|
||||||
|
//new Bomber(),
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue