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);
|