mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 01:48:32 +02:00
WS debugging messages and small changes
This commit is contained in:
parent
69d739400c
commit
4570319517
@ -1,4 +1,4 @@
|
|||||||
FROM node:12.12.0-alpine
|
FROM node:12.13.0-alpine
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PKG_DIR=dist/trilium-linux-x64-server
|
PKG_DIR=dist/trilium-linux-x64-server
|
||||||
NODE_VERSION=12.12.0
|
NODE_VERSION=12.13.0
|
||||||
|
|
||||||
if [ "$1" != "DONTCOPY" ]
|
if [ "$1" != "DONTCOPY" ]
|
||||||
then
|
then
|
||||||
|
@ -15,6 +15,7 @@ rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
|||||||
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
|
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
|
||||||
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
||||||
rm -r $SRC_DIR/node_modules/keyboard-layout/build/Release/*
|
rm -r $SRC_DIR/node_modules/keyboard-layout/build/Release/*
|
||||||
|
rm -r $SRC_DIR/node_modules/cld/build/Release/*
|
||||||
|
|
||||||
cp -r bin/deps/win-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
cp -r bin/deps/win-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||||
cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/
|
cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/
|
||||||
|
12
package-lock.json
generated
12
package-lock.json
generated
@ -2978,9 +2978,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "10.14.21",
|
"version": "10.17.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.21.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.0.tgz",
|
||||||
"integrity": "sha512-nuFlRdBiqbF+PJIEVxm2jLFcQWN7q7iWEJGsBV4n7v1dbI9qXB8im2pMMKMCUZe092sQb5SQft2DHfuQGK5hqQ==",
|
"integrity": "sha512-wuJwN2KV4tIRz1bu9vq5kSPasJ8IsEjZaP1ZR7KlmdUZvGF/rXy8DmXOVwUD0kAtvtJ7aqMKPqUXC0NUTDbrDg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6175,9 +6175,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"https-proxy-agent": {
|
"https-proxy-agent": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz",
|
||||||
"integrity": "sha512-y4jAxNEihqvBI5F3SaO2rtsjIOnnNA8sEbuiP+UhJZJHeM2NRm6c09ax2tgqme+SgUUvjao2fJXF4h3D6Cb2HQ==",
|
"integrity": "sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"agent-base": "^4.3.0",
|
"agent-base": "^4.3.0",
|
||||||
"debug": "^3.1.0"
|
"debug": "^3.1.0"
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
"html": "1.0.0",
|
"html": "1.0.0",
|
||||||
"html2plaintext": "2.1.2",
|
"html2plaintext": "2.1.2",
|
||||||
"http-proxy-agent": "2.1.0",
|
"http-proxy-agent": "2.1.0",
|
||||||
"https-proxy-agent": "3.0.0",
|
"https-proxy-agent": "3.0.1",
|
||||||
"image-type": "4.1.0",
|
"image-type": "4.1.0",
|
||||||
"imagemin": "7.0.0",
|
"imagemin": "7.0.0",
|
||||||
"imagemin-giflossy": "5.1.10",
|
"imagemin-giflossy": "5.1.10",
|
||||||
|
@ -72,7 +72,8 @@ async function ajax(url, method, data) {
|
|||||||
const options = {
|
const options = {
|
||||||
url: baseApiUrl + url,
|
url: baseApiUrl + url,
|
||||||
type: method,
|
type: method,
|
||||||
headers: getHeaders()
|
headers: getHeaders(),
|
||||||
|
timeout: 60000
|
||||||
};
|
};
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -97,8 +97,6 @@ class TreeCache {
|
|||||||
const missingNoteIds = noteIds.filter(noteId => this.notes[noteId] === undefined);
|
const missingNoteIds = noteIds.filter(noteId => this.notes[noteId] === undefined);
|
||||||
|
|
||||||
if (missingNoteIds.length > 0) {
|
if (missingNoteIds.length > 0) {
|
||||||
console.trace("Refreshing", missingNoteIds);
|
|
||||||
|
|
||||||
const resp = await server.post('tree/load', { noteIds: missingNoteIds });
|
const resp = await server.post('tree/load', { noteIds: missingNoteIds });
|
||||||
|
|
||||||
this.addResp(resp.notes, resp.branches, resp.relations);
|
this.addResp(resp.notes, resp.branches, resp.relations);
|
||||||
|
@ -89,7 +89,8 @@ function waitForSyncId(desiredSyncId) {
|
|||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
syncIdReachedListeners.push({
|
syncIdReachedListeners.push({
|
||||||
desiredSyncId,
|
desiredSyncId,
|
||||||
resolvePromise: res
|
resolvePromise: res,
|
||||||
|
start: Date.now()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -116,6 +117,9 @@ async function consumeSyncData() {
|
|||||||
|
|
||||||
syncIdReachedListeners = syncIdReachedListeners
|
syncIdReachedListeners = syncIdReachedListeners
|
||||||
.filter(l => l.desiredSyncId > lastSyncId);
|
.filter(l => l.desiredSyncId > lastSyncId);
|
||||||
|
|
||||||
|
syncIdReachedListeners.filter(l => Date.now() > l.start - 60000)
|
||||||
|
.forEach(l => console.log(`Waiting for syncId ${l.desiredSyncId} for ${Date.now() - l.start}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectWebSocket() {
|
function connectWebSocket() {
|
||||||
@ -138,7 +142,7 @@ setTimeout(() => {
|
|||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
if (Date.now() - lastPingTs > 30000) {
|
if (Date.now() - lastPingTs > 30000) {
|
||||||
console.log("Lost connection to server");
|
console.log(utils.now(), "Lost connection to server");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ws.readyState === ws.OPEN) {
|
if (ws.readyState === ws.OPEN) {
|
||||||
@ -148,7 +152,7 @@ setTimeout(() => {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
else if (ws.readyState === ws.CLOSED || ws.readyState === ws.CLOSING) {
|
else if (ws.readyState === ws.CLOSED || ws.readyState === ws.CLOSING) {
|
||||||
console.log("WS closed or closing, trying to reconnect");
|
console.log(utils.now(), "WS closed or closing, trying to reconnect");
|
||||||
|
|
||||||
ws = connectWebSocket();
|
ws = connectWebSocket();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user