mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-26 18:44:56 +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(`Received message of type ${type}`);
|
||||
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
@ -68,7 +70,7 @@ export const init = ({ resource = "", viewer, onUpdate }) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (type === "UPDATE" && onUpdate) {
|
||||
if (type === "UPDATE") {
|
||||
onUpdate(data);
|
||||
}
|
||||
});
|
||||
|
@ -154,6 +154,7 @@ export default class ApplicationPage extends React.Component {
|
||||
// )
|
||||
// );
|
||||
// await setAsyncState(newViewerState);
|
||||
console.log("Handle update viewer called");
|
||||
|
||||
this.setState({
|
||||
viewer: { ...this.state.viewer, ...newViewerState, type: "VIEWER" },
|
||||
|
@ -24,6 +24,7 @@ export const create = () => {
|
||||
clearTimeout(this.pingTimeout);
|
||||
|
||||
this.pingTimeout = setTimeout(() => {
|
||||
NodeLogging.log(`Did not receive ping in time. Disconnecting websocket`);
|
||||
this.terminate();
|
||||
}, 30000 + 1000);
|
||||
});
|
||||
@ -35,10 +36,9 @@ export const create = () => {
|
||||
ws.on("close", () => {
|
||||
global.websocket = null;
|
||||
console.log(global.websocket);
|
||||
console.log("Websocket disconnected");
|
||||
NodeLogging.log(`Websocket disconnected`);
|
||||
});
|
||||
|
||||
console.log("Websocket server started");
|
||||
NodeLogging.log(`Websocket server started`);
|
||||
|
||||
global.websocket = ws;
|
||||
|
Loading…
Reference in New Issue
Block a user