summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-09-04 10:18:15 +0200
committerGitHub <noreply@github.com>2022-09-04 10:18:15 +0200
commit8c92b197e49db0971189ba70e139170f403c8dc6 (patch)
tree006eba6a95f9b5c5069afcb2d60d88ef362180ac
parentMerge pull request #874 from fosscord/dev/Maddy/feat/welcomeMessages (diff)
parentMove component starts to before sentry enabling (diff)
downloadserver-8c92b197e49db0971189ba70e139170f403c8dc6.tar.xz
Merge pull request #873 from fosscord/dev/Maddy/fix/listeningAfterDb
Listen after DB start
-rw-r--r--src/Server.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Server.ts b/src/Server.ts
index 83e16fa6..c28ca0f9 100644
--- a/src/Server.ts
+++ b/src/Server.ts
@@ -35,7 +35,6 @@ process.on("SIGTERM", () => {
 //this is what has been added for the /stop API route
 
 async function main() {
-	server.listen(port);
 	await getOrInitialiseDatabase();
 	await Config.init();
 
@@ -52,7 +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) {
@@ -60,6 +62,7 @@ async function main() {
 			res.end(res.sentry + "\n");
 		});
 	}
+
 	console.log(`[Server] ${green(`listening on port ${bold(port)}`)}`);
 	// PluginLoader.loadPlugins();
 }