Move component starts to before sentry enabling

This commit is contained in:
Madeline
2022-09-04 18:17:27 +10:00
parent 16315a3170
commit 0cd59bbe37
+4 -2
View File
@@ -51,6 +51,10 @@ async function main() {
app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());
}
server.listen(port);
await Promise.all([api.start(), cdn.start(), gateway.start()]);
if (Config.get().sentry.enabled) {
app.use(Sentry.Handlers.errorHandler());
app.use(function onError(err: any, req: any, res: any, next: any) {
@@ -59,8 +63,6 @@ async function main() {
});
}
server.listen(port);
await Promise.all([api.start(), cdn.start(), gateway.start()]);
console.log(`[Server] ${green(`listening on port ${bold(port)}`)}`);
// PluginLoader.loadPlugins();
}