mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-20 02:37:09 +03:00
added logs to help debug why websocket disconnecting
This commit is contained in:
parent
1de7e53ac4
commit
1627545a84
@ -60,6 +60,8 @@ export const init = ({ resource = "", viewer, onUpdate }) => {
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Received message of type ${type}`);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -68,7 +70,7 @@ export const init = ({ resource = "", viewer, onUpdate }) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === "UPDATE" && onUpdate) {
|
if (type === "UPDATE") {
|
||||||
onUpdate(data);
|
onUpdate(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -154,6 +154,7 @@ export default class ApplicationPage extends React.Component {
|
|||||||
// )
|
// )
|
||||||
// );
|
// );
|
||||||
// await setAsyncState(newViewerState);
|
// await setAsyncState(newViewerState);
|
||||||
|
console.log("Handle update viewer called");
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
viewer: { ...this.state.viewer, ...newViewerState, type: "VIEWER" },
|
viewer: { ...this.state.viewer, ...newViewerState, type: "VIEWER" },
|
||||||
|
@ -24,6 +24,7 @@ export const create = () => {
|
|||||||
clearTimeout(this.pingTimeout);
|
clearTimeout(this.pingTimeout);
|
||||||
|
|
||||||
this.pingTimeout = setTimeout(() => {
|
this.pingTimeout = setTimeout(() => {
|
||||||
|
NodeLogging.log(`Did not receive ping in time. Disconnecting websocket`);
|
||||||
this.terminate();
|
this.terminate();
|
||||||
}, 30000 + 1000);
|
}, 30000 + 1000);
|
||||||
});
|
});
|
||||||
@ -35,10 +36,9 @@ export const create = () => {
|
|||||||
ws.on("close", () => {
|
ws.on("close", () => {
|
||||||
global.websocket = null;
|
global.websocket = null;
|
||||||
console.log(global.websocket);
|
console.log(global.websocket);
|
||||||
console.log("Websocket disconnected");
|
NodeLogging.log(`Websocket disconnected`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Websocket server started");
|
|
||||||
NodeLogging.log(`Websocket server started`);
|
NodeLogging.log(`Websocket server started`);
|
||||||
|
|
||||||
global.websocket = ws;
|
global.websocket = ws;
|
||||||
|
Loading…
Reference in New Issue
Block a user