Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Clean up disconnect/reconnect code
Browse files Browse the repository at this point in the history
  • Loading branch information
aronson committed Oct 29, 2023
1 parent be13def commit 8137c3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ircClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ export class CustomIrcClient extends IrcClient {
}
}
@Event('disconnected')
onDisconnected(addr: RemoteAddr) {
async onDisconnected(addr: RemoteAddr) {
const message = `Disconnected from server ${addr.hostname}:${addr.port}`;
if (this.exiting()) {
this.logger.done(message + '.');
} else {
this.logger.error(message + '!');
this.emitError('connect', Error());
await this.connect(this.state.remoteAddr.hostname, this.state.remoteAddr.port, this.state.remoteAddr.tls);
}
}
@Event('reconnecting')
Expand Down

0 comments on commit 8137c3b

Please sign in to comment.