mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-17 22:11:33 +03:00
clear websocket when it closes
This commit is contained in:
parent
856e4c66e2
commit
1de7e53ac4
@ -23,7 +23,7 @@ const websocketSend = async (type, data) => {
|
||||
if (!ws) {
|
||||
console.log("no websocket. creating now...");
|
||||
ws = Websocket.create();
|
||||
console.log(ws);
|
||||
console.log(ws ? "Successfully created websocket" : "Failed to create websocket");
|
||||
}
|
||||
|
||||
const encryptedData = await Utilities.encryptWithSecret(
|
||||
|
@ -33,10 +33,12 @@ export const create = () => {
|
||||
});
|
||||
|
||||
ws.on("close", () => {
|
||||
global.websocket = null;
|
||||
console.log(global.websocket);
|
||||
console.log("Websocket disconnected");
|
||||
});
|
||||
|
||||
console.log("Websocket server started");
|
||||
NodeLogging.log(`Websocket server started`);
|
||||
|
||||
global.websocket = ws;
|
||||
|
Loading…
Reference in New Issue
Block a user