Skip to content

Commit

Permalink
Patch a temp fix for an error that is caused by the Node Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyan114 committed Jul 5, 2023
1 parent bf1ca07 commit f169787
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/events/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default class ReadyEvent extends BaseEvent {


this.setStatus();
setInterval(this.setStatus, 9e5); // 15 minutes
setInterval(()=>this.setStatus(), 9e5); // 15 minutes

readline.cursorTo(process.stdout, 0);
process.stdout.write(
Expand Down Expand Up @@ -213,20 +213,20 @@ export default class ReadyEvent extends BaseEvent {

ws.on("connectFailed", (e) => {
this.connected = false;
setTimeout(this.connect, Math.random() * 1e4);
setTimeout(()=>this.connect(), Math.random() * 1e4);
console.log(`❌ WebSocket Error: ${e.toString()}`);
});

ws.on("connect", (connection) => {
connection.on("error", (e) => {
this.connected = false;
setTimeout(this.connect, Math.random() * 1e4);
setTimeout(()=>this.connect(), Math.random() * 1e4);
console.log(`❌ WebSocket Error: ${e.toString()}`);
});

connection.on("close", (e) => {
this.connected = false;
setTimeout(this.connect, Math.random() * 1e4);
setTimeout(()=>this.connect(), Math.random() * 1e4);
console.log(`❌ WebSocket Error: ${e.toString()}`);
});

Expand Down

0 comments on commit f169787

Please sign in to comment.