summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 01:15:26 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 01:15:26 +0200
commit577bfd6f37052f4415dcfa062983759e0c163693 (patch)
treee5975fb5ecf848c51b6627338f13c6ad1d1a1265 /src/util
parent1.3.49 (diff)
downloadserver-577bfd6f37052f4415dcfa062983759e0c163693.tar.xz
:bug: fix config: don't use mongodb change streams
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Config.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/Config.ts b/src/util/Config.ts
index 10dddc88..903a5d59 100644
--- a/src/util/Config.ts
+++ b/src/util/Config.ts
@@ -4,15 +4,15 @@ import db, { MongooseCache } from "./Database";
 import { Snowflake } from "./Snowflake";
 import crypto from "crypto";
 
-var Config = new MongooseCache(db.collection("config"), [], { onlyEvents: false, array: false });
+var config: any;
 
 export default {
 	init: async function init(defaultOpts: any = DefaultOptions) {
-		await Config.init();
-		return this.set((Config.data || {}).merge(defaultOpts));
+		config = await db.collection("config").findOne({});
+		return this.set((config || {}).merge(defaultOpts));
 	},
 	get: function get() {
-		return <DefaultOptions>Config.data;
+		return config as DefaultOptions;
 	},
 	set: function set(val: any) {
 		return db.collection("config").updateOne({}, { $set: val }, { upsert: true });