mirror of
https://github.com/zadam/trilium.git
synced 2025-02-20 21:13:11 +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;
|
||||
lastPingTs = new Date().getTime();
|
||||
let connectionBrokenNotification = null;
|
||||
|
||||
setInterval(async () => {
|
||||
if (new Date().getTime() - lastPingTs > 30000) {
|
||||
if (!connectionBrokenNotification) {
|
||||
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");
|
||||
console.log("Lost connection to server");
|
||||
}
|
||||
|
||||
ws.send(JSON.stringify({
|
||||
|
|
Loading…
Reference in a new issue