Parcourir la source

[misc] mongodb: drop intermediate dbPromise

It would confuse the logic of a follow-up commit.
Jakob Ackermann il y a 6 ans
Parent
commit
a52c0fe9fb
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      services/chat/app/js/mongodb.js

+ 1 - 2
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() {