summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-08 15:39:46 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-08 15:39:46 +0100
commit451d2c3611527113b1dd8c790426687e1c98a80a (patch)
tree37b4f7b1b41eb71a4b3941541f98f8e7b13b3a8b /src/util
parent:arrow_up: bump lambert-db to version 1.1.6 (diff)
downloadserver-451d2c3611527113b1dd8c790426687e1c98a80a.tar.xz
:arrow_up: bump lambert-db
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Config.ts2
-rw-r--r--src/util/Database.ts5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/util/Config.ts b/src/util/Config.ts
index b22e88e0..5886b268 100644
--- a/src/util/Config.ts
+++ b/src/util/Config.ts
@@ -5,7 +5,7 @@ var Config: ProviderCache;
 
 export default {
 	init: async function init(opts: DefaultOptions = DefaultOptions) {
-		Config = db.data.config({}).cache();
+		Config = await db.data.config({}).cache();
 		await Config.init();
 		await Config.set(opts.merge(Config.cache || {}));
 	},
diff --git a/src/util/Database.ts b/src/util/Database.ts
index d842ac6b..ed45a9ad 100644
--- a/src/util/Database.ts
+++ b/src/util/Database.ts
@@ -1,6 +1,9 @@
 import { MongoDatabase } from "lambert-db";
 
 // TODO: load url from config
-const db = new MongoDatabase("mongodb://127.0.0.1:27017/lambert?readPreference=secondaryPreferred");
+const db = new MongoDatabase("mongodb://127.0.0.1:27017/lambert?readPreference=secondaryPreferred", {
+	useNewUrlParser: true,
+	useUnifiedTopology: false,
+});
 
 export default db;