[misc] mongodb: drop intermediate dbPromise
It would confuse the logic of a follow-up commit.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user