mirror of
https://github.com/zadam/trilium.git
synced 2025-02-22 14:03:36 +08:00
connection lost error is now logged only to the console, it was too annoying while being mostly harmless
This commit is contained in:
parent
2a53bb03ae
commit
a40bf71fd4
1 changed files with 1 additions and 17 deletions
|
@ -82,26 +82,10 @@ setTimeout(() => {
|
||||||
|
|
||||||
lastSyncId = glob.maxSyncIdAtLoad;
|
lastSyncId = glob.maxSyncIdAtLoad;
|
||||||
lastPingTs = new Date().getTime();
|
lastPingTs = new Date().getTime();
|
||||||
let connectionBrokenNotification = null;
|
|
||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
if (new Date().getTime() - lastPingTs > 30000) {
|
if (new Date().getTime() - lastPingTs > 30000) {
|
||||||
if (!connectionBrokenNotification) {
|
console.log("Lost connection to server");
|
||||||
connectionBrokenNotification = $.notify({
|
|
||||||
// options
|
|
||||||
message: "Lost connection to server"
|
|
||||||
},{
|
|
||||||
// options
|
|
||||||
type: 'danger',
|
|
||||||
delay: 100000000 // keep it until we explicitly close it
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (connectionBrokenNotification) {
|
|
||||||
await connectionBrokenNotification.close();
|
|
||||||
connectionBrokenNotification = null;
|
|
||||||
|
|
||||||
infoService.showMessage("Re-connected to server");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.send(JSON.stringify({
|
ws.send(JSON.stringify({
|
||||||
|
|
Loading…
Reference in a new issue