summary refs log tree commit diff
path: root/src/Server.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-22 22:18:59 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-22 22:18:59 +1000
commit0cd9a46eea260c299db2e2983f7214ab8b119d29 (patch)
tree5fbb98e7adcfeab81594732089474afdde5893f9 /src/Server.ts
parentMerge branch 'master' into feat/captchaVerify (diff)
parentMerge remote-tracking branch 'Puyodead1/patch/prettier-config' into staging (diff)
downloadserver-0cd9a46eea260c299db2e2983f7214ab8b119d29.tar.xz
Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify
Diffstat (limited to '')
-rw-r--r--src/Server.ts (renamed from bundle/src/Server.ts)7
1 files changed, 5 insertions, 2 deletions
diff --git a/bundle/src/Server.ts b/src/Server.ts

index 71a60d49..4d5d6422 100644 --- a/bundle/src/Server.ts +++ b/src/Server.ts
@@ -7,9 +7,10 @@ import * as Gateway from "@fosscord/gateway"; import { CDNServer } from "@fosscord/cdn"; import express from "express"; import { green, bold, yellow } from "picocolors"; -import { Config, initDatabase } from "@fosscord/util"; +import { Config, getOrInitialiseDatabase } from "@fosscord/util"; import * as Sentry from "@sentry/node"; import * as Tracing from "@sentry/tracing"; +// import { PluginLoader } from "@fosscord/util"; const app = express(); const server = http.createServer(); @@ -26,6 +27,7 @@ const gateway = new Gateway.Server({ server, port, production }); //this is what has been added for the /stop API route process.on('SIGTERM', () => { + setTimeout(()=>process.exit(0), 3000) server.close(() => { console.log("Stop API has been successfully POSTed, SIGTERM sent") }) @@ -34,7 +36,7 @@ process.on('SIGTERM', () => { async function main() { server.listen(port); - await initDatabase(); + await getOrInitialiseDatabase(); await Config.init(); // only set endpointPublic, if not already set await Config.set({ @@ -93,6 +95,7 @@ async function main() { }); } console.log(`[Server] ${green(`listening on port ${bold(port)}`)}`); + // PluginLoader.loadPlugins(); } main().catch(console.error);