mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[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