1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 12:42:44 +01:00

Revert "Revert "Remove unnessesary async and close on error in gateway""

This reverts commit 39f1a694c6.
This commit is contained in:
Madeline 2022-07-22 22:21:30 +10:00
parent 39f1a694c6
commit b59ad201c2
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
return await OPCodeHandler.call(this, data);
} catch (error) {
console.error(error);
if (!this.CLOSED && this.CLOSING)
// if (!this.CLOSED && this.CLOSING)
return this.close(CLOSECODES.Unknown_error);
}
}

View File

@ -6,7 +6,7 @@ try {
}
import { Payload, WebSocket } from "@fosscord/gateway";
export async function Send(socket: WebSocket, data: Payload) {
export function Send(socket: WebSocket, data: Payload) {
let buffer: Buffer | string;
if (socket.encoding === "etf") buffer = erlpack.pack(data);
// TODO: encode circular object