mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-25 09:54:34 +00:00
Merge branch 'main' of https://github.com/discord-open-source/discord-server-util into main
This commit is contained in:
@@ -6,7 +6,7 @@ const uri = process.env.MONGO_URL || "mongodb://localhost:27017/fosscord?readPre
|
||||
|
||||
console.log(`[DB] connect: ${uri}`);
|
||||
|
||||
const connection = mongoose.createConnection(uri, { autoIndex: true });
|
||||
const connection = mongoose.createConnection(uri, { autoIndex: true, useNewUrlParser: true, useUnifiedTopology: true });
|
||||
|
||||
export default <Connection>connection;
|
||||
|
||||
@@ -32,6 +32,7 @@ export class MongooseCache extends EventEmitter {
|
||||
}
|
||||
|
||||
init = async () => {
|
||||
// @ts-ignore
|
||||
this.stream = this.collection.watch(this.pipeline, { fullDocument: "updateLookup" });
|
||||
|
||||
this.stream.on("change", this.change);
|
||||
|
||||
Reference in New Issue
Block a user