Create dummy bomber database, no alert on background sync fail

This commit is contained in:
Bel LaPointe
2021-02-26 23:17:53 -06:00
parent efed1ce04f
commit 326d6a60a4

View File

@@ -1303,13 +1303,23 @@
sync()
{
console.log("syncing to replicas: " + this.pendingSyncCount());
var n = this.pendingSyncCount();
try
{
this.deltas.popEach((key) => {
console.log("syncing to replicas: " + key);
this.replicate(key);
});
}
catch (e)
{
console.log("failed to sync: " + e);
}
finally
{
this.writePendingSyncCount();
}
}
pendingSyncCount()
{
@@ -1319,7 +1329,7 @@
writePendingSyncCount()
{
var n = this.pendingSyncCount();
var s = "(" + n + ")";
var s = "(" + n + " items pending replication)";
if (! n)
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 {
constructor()
{
@@ -1467,10 +1498,10 @@
}
}
globalStorage = new NamespacedDatabase("4", new Local());
globalStorage = new MultiDatabase(
new NamespacedDatabase("A", new Local()),
new NamespacedDatabase("B", new Local()),
//new Bomber(),
);
/*