-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make metrics less error prone #810
base: develop
Are you sure you want to change the base?
Conversation
Depends on #811 due to requiring Node 14. |
@@ -1,5 +1,5 @@ | |||
/* | |||
Copyright 2017 - 2019 matrix-appservice-discord | |||
Copyright 2017 - 2019 matrix-appservice-discord, 2022 (C) The Matrix.org Foundation C.I.C. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let's just make a single change to update all of these at once 😆
@@ -181,6 +181,16 @@ async function run(): Promise<void> { | |||
const roomhandler = discordbot.RoomHandler; | |||
const eventProcessor = discordbot.MxEventProcessor; | |||
|
|||
|
|||
process.once("SIGINT", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should trigger on SIGTERM
too.
public async stop(): Promise<void> { | ||
public stop(): void { | ||
this.presenceHandler.Stop(); | ||
this._bot?.destroy(); | ||
this._bot = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick suggestion:
if (this._bot) {
this._bot.destroy();
this._bot = undefined;
}
since there's a branch buried in the ?.
anyways.
The bridge is prone to erroring with things like:
Which is mostly due to the fact that our metrics system is:
I've also updated the matrix-appservice-bridge library to be on the latest version, I don't think it's changes will affect us too badly.