[misc] mongodb: drop intermediate dbPromise

It would confuse the logic of a follow-up commit.
This commit is contained in:
Jakob Ackermann 2020-08-28 09:11:33 +01:00
parent 1b70189fb1
commit a52c0fe9fb

View file

@ -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() {