From a52c0fe9fb7e9ad1c7bbcc1ecc75dbf04d16f592 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 28 Aug 2020 09:11:33 +0100 Subject: [PATCH] [misc] mongodb: drop intermediate dbPromise It would confuse the logic of a follow-up commit. --- services/chat/app/js/mongodb.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/chat/app/js/mongodb.js b/services/chat/app/js/mongodb.js index 5b0168bda8..6dfb575b7e 100644 --- a/services/chat/app/js/mongodb.js +++ b/services/chat/app/js/mongodb.js @@ -2,10 +2,9 @@ const Settings = require('settings-sharelatex') const { MongoClient, ObjectId } = require('mongodb') const clientPromise = MongoClient.connect(Settings.mongo.url) -const dbPromise = clientPromise.then((client) => client.db()) async function getCollection(name) { - return (await dbPromise).collection(name) + return (await clientPromise).db().collection(name) } async function waitForDb() {