From 762bdd9bd51fb8d6133e0a73c2558b23774b7e7d Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sun, 10 Jul 2022 22:20:05 +1000 Subject: Start listening after database and config has been loaded --- bundle/src/Server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts index 71a60d49..74a36114 100644 --- a/bundle/src/Server.ts +++ b/bundle/src/Server.ts @@ -33,7 +33,6 @@ process.on('SIGTERM', () => { //this is what has been added for the /stop API route async function main() { - server.listen(port); await initDatabase(); await Config.init(); // only set endpointPublic, if not already set @@ -84,7 +83,6 @@ async function main() { app.use(Sentry.Handlers.requestHandler()); app.use(Sentry.Handlers.tracingHandler()); } - 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) { @@ -92,6 +90,8 @@ async function main() { res.end(res.sentry + "\n"); }); } + + await Promise.all([api.start(), cdn.start(), gateway.start()]); console.log(`[Server] ${green(`listening on port ${bold(port)}`)}`); } -- cgit 1.4.1 From 0cd59bbe374581c7c3e008b74f03f5f40c0da4b0 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sun, 4 Sep 2022 18:15:02 +1000 Subject: Move component starts to before sentry enabling --- src/Server.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Server.ts b/src/Server.ts index 89a3cea2..c28ca0f9 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -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(); } -- cgit 1.4.1